|
Packit Service |
639957 |
# copied over from JSON::XS and modified to use JSON
|
|
Packit Service |
639957 |
|
|
Packit Service |
639957 |
BEGIN { $| = 1; print "1..4\n"; }
|
|
Packit Service |
639957 |
BEGIN { $ENV{PERL_JSON_BACKEND} ||= "JSON::backportPP"; }
|
|
Packit Service |
639957 |
|
|
Packit Service |
639957 |
use JSON;
|
|
Packit Service |
639957 |
|
|
Packit Service |
639957 |
my $xs = JSON->new->allow_nonref;
|
|
Packit Service |
639957 |
|
|
Packit Service |
639957 |
eval { $xs->decode ("[] ") };
|
|
Packit Service |
639957 |
print $@ ? "not " : "", "ok 1\n";
|
|
Packit Service |
639957 |
eval { $xs->decode ("[] x") };
|
|
Packit Service |
639957 |
print $@ ? "" : "not ", "ok 2\n";
|
|
Packit Service |
639957 |
print 2 == ($xs->decode_prefix ("[][]"))[1] ? "" : "not ", "ok 3\n";
|
|
Packit Service |
639957 |
print 3 == ($xs->decode_prefix ("[1] t"))[1] ? "" : "not ", "ok 4\n";
|
|
Packit Service |
639957 |
|