| OLD | NEW |
| (Empty) |
| 1 #!/usr/bin/perl | |
| 2 | |
| 3 BEGIN { | |
| 4 $ENV{ PERL_JSON_BACKEND } = $ARGV[0] || 'JSON::backportPP'; | |
| 5 } | |
| 6 | |
| 7 use strict; | |
| 8 use Test::More tests => 4; | |
| 9 | |
| 10 use JSON; | |
| 11 | |
| 12 my $json = JSON->new->allow_nonref(); | |
| 13 | |
| 14 my @vs = $json->incr_parse('"a\"bc'); | |
| 15 | |
| 16 ok( not scalar(@vs) ); | |
| 17 | |
| 18 @vs = $json->incr_parse('"'); | |
| 19 | |
| 20 is( $vs[0], "a\"bc" ); | |
| 21 | |
| 22 | |
| 23 $json = JSON->new; | |
| 24 | |
| 25 @vs = $json->incr_parse('"a\"bc'); | |
| 26 ok( not scalar(@vs) ); | |
| 27 @vs = eval { $json->incr_parse('"') }; | |
| 28 ok($@ =~ qr/JSON text must be an object or array/); | |
| 29 | |
| OLD | NEW |