Fix "Can't locate t/lib/is_bool.pm in @INC" when . is not in @INC
[p5sagit/JSON-MaybeXS.git] / t / xs.t
CommitLineData
3be1e192 1use strict;
4e1fb2f8 2use warnings;
16205c4a 3
b4d74169 4# hide Cpanel::JSON::XS
5use lib map {
6 my ( $m, $c ) = ( $_, qq{die "Can't locate $_ (hidden)\n"} );
7 sub { return unless $_[1] eq $m; open my $fh, "<", \$c; return $fh }
8} qw{Cpanel/JSON/XS.pm};
9
2c67ae64 10use Test::More 0.88;
3be1e192 11use JSON::MaybeXS;
12
16205c4a 13unless ( eval { require JSON::XS; 1 } ) {
a3dc87a6 14 plan skip_all => 'No JSON::XS';
16205c4a 15}
3be1e192 16
0b694b31 17diag 'Using JSON::XS ', JSON::XS->VERSION;
18
16205c4a 19is( JSON, 'JSON::XS', 'Correct JSON class' );
3be1e192 20
16205c4a 21is( \&encode_json, \&JSON::XS::encode_json, 'Correct encode_json function' );
22is( \&decode_json, \&JSON::XS::decode_json, 'Correct encode_json function' );
3be1e192 23
9c4f62de 24require './t/lib/is_bool.pm';
1ca3b561 25
3be1e192 26done_testing;