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