1 | BEGIN { $| = 1; print "1..20\n"; } |
1 | BEGIN { $| = 1; print "1..20\n"; } |
|
|
2 | BEGIN { $^W = 0 } # hate |
2 | |
3 | |
3 | use JSON::XS; |
4 | use JSON::XS; |
4 | |
5 | |
5 | $json = JSON::XS->new->convert_blessed; |
6 | $json = JSON::XS->new->convert_blessed->allow_tags->allow_nonref; |
6 | |
7 | |
7 | print "ok 1\n"; |
8 | print "ok 1\n"; |
8 | |
9 | |
9 | sub JSON::XS::tojson::TO_JSON { |
10 | sub JSON::XS::tojson::TO_JSON { |
10 | print @_ == 1 ? "" : "not ", "ok 3\n"; |
11 | print @_ == 1 ? "" : "not ", "ok 3\n"; |
… | |
… | |
19 | |
20 | |
20 | $enc = $json->encode ($obj); |
21 | $enc = $json->encode ($obj); |
21 | print $enc eq 7 ? "" : "not ", "ok 6 # $enc\n"; |
22 | print $enc eq 7 ? "" : "not ", "ok 6 # $enc\n"; |
22 | |
23 | |
23 | print "ok 7\n"; |
24 | print "ok 7\n"; |
24 | |
|
|
25 | $json = JSON::XS->new->allow_tags->allow_nonref; |
|
|
26 | |
25 | |
27 | sub JSON::XS::freeze::FREEZE { |
26 | sub JSON::XS::freeze::FREEZE { |
28 | print @_ == 2 ? "" : "not ", "ok 8\n"; |
27 | print @_ == 2 ? "" : "not ", "ok 8\n"; |
29 | print $_[1] eq "JSON" ? "" : "not ", "ok 9\n"; |
28 | print $_[1] eq "JSON" ? "" : "not ", "ok 9\n"; |
30 | print JSON::XS::freeze:: eq ref $_[0] ? "" : "not ", "ok 10\n"; |
29 | print JSON::XS::freeze:: eq ref $_[0] ? "" : "not ", "ok 10\n"; |