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