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