--- JSON-XS/t/17_relaxed.t 2007/08/27 01:49:01 1.1 +++ JSON-XS/t/17_relaxed.t 2007/12/05 10:59:31 1.3 @@ -1,4 +1,4 @@ -BEGIN { $| = 1; print "1..7\n"; } +BEGIN { $| = 1; print "1..8\n"; } use utf8; use JSON::XS; @@ -10,12 +10,13 @@ my $json = JSON::XS->new->relaxed; -ok ('[1,2,3]' eq to_json $json->decode (' [1,2, 3]')); -ok ('[1,2,4]' eq to_json $json->decode ('[1,2, 4 , ]')); +ok ('[1,2,3]' eq encode_json $json->decode (' [1,2, 3]')); +ok ('[1,2,4]' eq encode_json $json->decode ('[1,2, 4 , ]')); ok (!eval { $json->decode ('[1,2, 3,4,,]') }); ok (!eval { $json->decode ('[,1]') }); -ok ('{"1":2}' eq to_json $json->decode (' {"1":2}')); -ok ('{"1":2}' eq to_json $json->decode ('{"1":2,}')); +ok ('{"1":2}' eq encode_json $json->decode (' {"1":2}')); +ok ('{"1":2}' eq encode_json $json->decode ('{"1":2,}')); ok (!eval { $json->decode ('{,}') }); +ok ('[1,2]' eq encode_json $json->decode ("[1#,2\n ,2,# ] \n\t]"));