1# copied over from JSON::PP::XS and modified to use JSON::PP 2 3BEGIN { $| = 1; print "1..4\n"; } 4BEGIN { $ENV{PERL_JSON_BACKEND} = 0; } 5 6use JSON::PP; 7 8my $xs = JSON::PP->new->allow_nonref; 9 10eval { $xs->decode ("[] ") }; 11print $@ ? "not " : "", "ok 1\n"; 12eval { $xs->decode ("[] x") }; 13print $@ ? "" : "not ", "ok 2\n"; 14print 2 == ($xs->decode_prefix ("[][]"))[1] ? "" : "not ", "ok 3\n"; 15print 3 == ($xs->decode_prefix ("[1] t"))[1] ? "" : "not ", "ok 4\n"; 16 17