ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/JSON-XS/t/52_object.t
(Generate patch)

Comparing JSON-XS/t/52_object.t (file contents):
Revision 1.1 by root, Mon Oct 28 23:19:54 2013 UTC vs.
Revision 1.3 by root, Tue Oct 29 15:55:49 2013 UTC

1BEGIN { $| = 1; print "1..20\n"; } 1BEGIN { $| = 1; print "1..20\n"; }
2BEGIN { $^W = 0 } # hate
2 3
3use JSON::XS; 4use JSON::XS;
4 5
5$json = JSON::XS->new->convert_blessed; 6$json = JSON::XS->new->convert_blessed->allow_tags->allow_nonref;
6 7
7print "ok 1\n"; 8print "ok 1\n";
8 9
9sub JSON::XS::tojson::TO_JSON { 10sub 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);
21print $enc eq 7 ? "" : "not ", "ok 6 # $enc\n"; 22print $enc eq 7 ? "" : "not ", "ok 6 # $enc\n";
22 23
23print "ok 7\n"; 24print "ok 7\n";
24
25$json = JSON::XS->new->allow_tags->allow_nonref;
26 25
27sub JSON::XS::freeze::FREEZE { 26sub 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";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines