15759b3d2Safresh1# copied over from JSON::XS and modified to use JSON::PP 2898184e3Ssthen 3f3efcd01Safresh1use strict; 4*256a93a4Safresh1use warnings; 5f3efcd01Safresh1use Test::More; 6f3efcd01Safresh1BEGIN { plan tests => 4 }; 7f3efcd01Safresh1 8898184e3SsthenBEGIN { $ENV{PERL_JSON_BACKEND} = 0; } 9898184e3Ssthen 10898184e3Ssthenuse JSON::PP; 11898184e3Ssthen 12f3efcd01Safresh1my $pp = JSON::PP->new->latin1->allow_nonref; 13898184e3Ssthen 14f3efcd01Safresh1eval { $pp->decode ("[] ") }; 15f3efcd01Safresh1ok (!$@); 16f3efcd01Safresh1eval { $pp->decode ("[] x") }; 17f3efcd01Safresh1ok ($@); 18f3efcd01Safresh1ok (2 == ($pp->decode_prefix ("[][]"))[1]); 19f3efcd01Safresh1ok (3 == ($pp->decode_prefix ("[1] t"))[1]); 20898184e3Ssthen 21