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