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