1# copied over from JSON::XS and modified to use JSON::PP 2 3use strict; 4use warnings; 5use Test::More; 6BEGIN { plan tests => 4 }; 7 8BEGIN { $ENV{PERL_JSON_BACKEND} = 0; } 9 10use JSON::PP; 11 12my $pp = JSON::PP->new->latin1->allow_nonref; 13 14eval { $pp->decode ("[] ") }; 15ok (!$@); 16eval { $pp->decode ("[] x") }; 17ok ($@); 18ok (2 == ($pp->decode_prefix ("[][]"))[1]); 19ok (3 == ($pp->decode_prefix ("[1] t"))[1]); 20 21