1 2use strict; 3use Test::More; 4 5BEGIN { plan tests => 4 }; 6 7BEGIN { $ENV{PERL_JSON_BACKEND} = 1; } 8 9use JSON -support_by_pp; 10 11BEGIN { 12 use lib qw(t); 13 use _unicode_handling; 14} 15 16 17SKIP: { 18 skip "can't use JSON::XS.", 4, unless( JSON->backend->is_xs ); 19 20my $json = new JSON; 21my $bool = $json->allow_nonref->decode('true'); 22 23# it's normal 24isa_ok( $bool, 'JSON::Boolean' ); 25is( $json->encode([ JSON::true ]), '[true]' ); 26 27# make XS non support flag enable! 28$bool = $json->allow_singlequote->decode('true'); 29 30isa_ok( $bool, 'JSON::Boolean' ); 31is( $json->encode([ JSON::true ]), '[true]' ); 32 33} 34 35__END__ 36