File: 23_array_ctx.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 (19 lines) | stat: -rw-r--r-- 588 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
print "1..5\n";
use Cpanel::JSON::XS;

sub FREEZE { ( 123, 456 ); }
@foo = Cpanel::JSON::XS->new->allow_tags->encode(bless {}, 'main');

print "ok 1\n";

@foo = Cpanel::JSON::XS->new->filter_json_object(sub {12})->decode('[{}]');
print "ok 2\n";

@foo = Cpanel::JSON::XS->new->filter_json_object(sub {return shift, 1})->decode('[{}, {}]');
print "ok 3\n";

@foo = Cpanel::JSON::XS->new->filter_json_single_key_object(1 => sub { [] })->decode('{"1":0}');
print "ok 4\n";

@foo = Cpanel::JSON::XS->new->filter_json_single_key_object(1 => sub { [], [] })->decode('{"1":0}');
print "ok 5\n";