X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=t%2F9_jsondump_00_base.t;h=40fe489b0cb224007db70a01af0da6a58277db8a;hb=HEAD;hp=a124a4f60d1e3d5ec0a3a14f56f9cf037e7f52ca;hpb=d710d6cd21be21c0ab2df3566c2bd61d9015cac6;p=chaz%2Fp5-CGI-Ex diff --git a/t/9_jsondump_00_base.t b/t/9_jsondump_00_base.t index a124a4f..40fe489 100644 --- a/t/9_jsondump_00_base.t +++ b/t/9_jsondump_00_base.t @@ -7,7 +7,7 @@ =cut use strict; -use Test::More tests => 49; +use Test::More tests => 57; use_ok('CGI::Ex::JSONDump'); @@ -61,8 +61,8 @@ test_dump({a => sub {}}, "{\"a\":\"CODE\"}", {handle_unknown_types => sub {my $s test_dump({a => 1}, "{}", {skip_keys => ['a']}); test_dump({a => 1}, "{}", {skip_keys => {a=>1}}); -test_dump({2 => 1, _a => 1}, "{2:1,\"_a\":1}", {pretty=>0}); -test_dump({2 => 1, _a => 1}, "{2:1}", {pretty=>0, skip_keys_qr => qr/^_/}); +test_dump({2 => 1, _a => 1}, "{\"2\":1,\"_a\":1}", {pretty=>0}); +test_dump({2 => 1, _a => 1}, "{\"2\":1}", {pretty=>0, skip_keys_qr => qr/^_/}); test_dump({a => 1}, "{\n \"a\" : 1\n}", {pretty => 1}); test_dump({a => 1}, "{\n \"a\" : 1\n}", {pretty => 1, hash_nl => "\n", hash_sep => " : ", indent => " "}); @@ -80,15 +80,23 @@ test_dump(['a' => 1], "[\"a\",1]", {pretty => 0, array_nl => "\n"}); test_dump(1, "1"); +test_dump(0, "0"); test_dump('1.0', '"1.0"'); test_dump('123456789012345', '"123456789012345"'); +test_dump('0.1', '0.1'); +test_dump('.1', '".1"'); +test_dump('00.1', '"00.1"'); test_dump('a', '"a"'); test_dump("\n", '"\\n"'); test_dump("\\", '"\\\\"'); test_dump('