do { require ... } will explode if the require failed - need an eval here!
[p5sagit/JSON-MaybeXS.git] / t / preload_xs.t
CommitLineData
16205c4a 1use strict;
2use warnings FATAL => 'all';
b461f143 3use if !eval { require JSON::XS; 1; }, 'Test::More', skip_all => 'No JSON::XS';
16205c4a 4use Test::More;
5use JSON::MaybeXS;
6
7is( JSON, 'JSON::XS', 'Correct JSON class' );
8
9is( \&encode_json, \&JSON::XS::encode_json, 'Correct encode_json function' );
10is( \&decode_json, \&JSON::XS::decode_json, 'Correct encode_json function' );
11
12done_testing;