df3d2b33ed65af5207ce50e7b8a84b8e2bd3cab5
[p5sagit/JSON-MaybeXS.git] / t / pp.t
1 use strict;
2 use warnings;
3
4 # hide Cpanel::JSON::XS, JSON::XS
5 use lib map {
6     my $m = $_;
7     sub { return unless $_[1] eq $m; die "Can't locate $m in \@INC (hidden).\n" };
8 } qw{Cpanel/JSON/XS.pm JSON/XS.pm};
9
10 use if !eval { require JSON::PP; 1; }, 'Test::More', skip_all => 'No JSON::PP';
11 use Test::More 0.88;
12 use JSON::MaybeXS;
13
14 diag 'Using JSON::PP ', JSON::PP->VERSION;
15
16 is(JSON, 'JSON::PP', 'Correct JSON class');
17
18 is(
19   \&encode_json, \&JSON::PP::encode_json,
20   'Correct encode_json function'
21 );
22
23 is(
24   \&decode_json, \&JSON::PP::decode_json,
25   'Correct encode_json function'
26 );
27
28 require './t/lib/is_bool.pm';
29
30 done_testing;