--- JSON-XS/t/03_types.t 2007/03/22 23:24:18 1.1 +++ JSON-XS/t/03_types.t 2007/03/29 02:45:49 1.3 @@ -1,4 +1,4 @@ -BEGIN { $| = 1; print "1..14\n"; } +BEGIN { $| = 1; print "1..19\n"; } use utf8; use JSON::XS; @@ -8,7 +8,6 @@ print $_[0] ? "" : "not ", "ok ", ++$test, "\n"; } -use PApp::Util; ok (!defined JSON::XS->new->allow_nonref (1)->decode ('null')); ok (JSON::XS->new->allow_nonref (1)->decode ('true') == 1); ok (JSON::XS->new->allow_nonref (1)->decode ('false') == 0); @@ -25,3 +24,9 @@ ok ('[{"1":[5]}]' eq to_json [{1 => [5]}]); ok ('{"1":2,"3":4}' eq JSON::XS->new->canonical (1)->encode (from_json '{ "1" : 2, "3" : 4 }')); ok ('{"1":2,"3":1.2}' eq JSON::XS->new->canonical (1)->encode (from_json '{ "1" : 2, "3" : 1.2 }')); + +ok ('[true]' eq to_json [JSON::XS::true]); +ok ('[false]' eq to_json [JSON::XS::false]); +ok ('[true]' eq to_json [\1]); +ok ('[false]' eq to_json [\0]); +ok ('[null]' eq to_json [undef]);