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