File: 15_prefix.t

package info (click to toggle)
libcpanel-json-xs-perl 4.39-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,872 kB
  • sloc: perl: 1,165; makefile: 8
file content (15 lines) | stat: -rw-r--r-- 320 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use Test::More tests => 4;
use Cpanel::JSON::XS;

my $xs = Cpanel::JSON::XS->new->latin1->allow_nonref;

eval { $xs->decode ("[] ") };
ok (!$@);
SKIP: {
  skip "5.6", 1 if $] < 5.008;
  eval { $xs->decode ("[] x") };
  ok ($@);
}
ok (2 == ($xs->decode_prefix ("[][]"))[1]);
ok (3 == ($xs->decode_prefix ("[1] t"))[1]);