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