| OLD | NEW |
| (Empty) |
| 1 #!/usr/bin/perl -w | |
| 2 | |
| 3 use strict; | |
| 4 | |
| 5 use Test::More; | |
| 6 use strict; | |
| 7 | |
| 8 BEGIN { plan tests => 11 }; | |
| 9 | |
| 10 BEGIN { $ENV{PERL_JSON_BACKEND} = 1; } | |
| 11 | |
| 12 use JSON; | |
| 13 | |
| 14 SKIP: { | |
| 15 skip "can't use JSON::XS.", 11, unless( JSON->backend->is_xs ); | |
| 16 | |
| 17 my $json = new JSON; | |
| 18 | |
| 19 is($json->encode([!1]), '[""]'); | |
| 20 is($json->encode([!!2]), '["1"]'); | |
| 21 | |
| 22 is($json->encode([ 'a' eq 'b' ]), '[""]'); | |
| 23 is($json->encode([ 'a' eq 'a' ]), '["1"]'); | |
| 24 | |
| 25 is($json->encode([ ('a' eq 'b') + 1 ]), '[1]'); | |
| 26 is($json->encode([ ('a' eq 'a') + 1 ]), '[2]'); | |
| 27 | |
| 28 ok(JSON::true eq 'true'); | |
| 29 ok(JSON::true eq '1'); | |
| 30 ok(JSON::true == 1); | |
| 31 isa_ok(JSON::true, JSON->backend . '::Boolean'); | |
| 32 isa_ok(JSON::true, 'JSON::Boolean'); | |
| 33 | |
| 34 } | |
| OLD | NEW |