--- CBOR-XS/t/50_rfc.t 2013/10/26 10:41:12 1.1 +++ CBOR-XS/t/50_rfc.t 2014/01/05 14:24:54 1.6 @@ -1,4 +1,4 @@ -BEGIN { $| = 1; print "1..77\n"; } +BEGIN { $| = 1; print "1..79\n"; } # examples from rfc7049 @@ -8,15 +8,18 @@ binmode DATA; binmode STDOUT, ":utf8"; +my $test; + sub ok($;$) { print $_[0] ? "" : "not ", "ok ", ++$test, " - $_[1]\n"; } -$Data::Dumper::Terse = 1; -$Data::Dumper::Sortkeys = 1; -$Data::Dumper::Pair = ','; -$Data::Dumper::Useqq = 1; -$Data::Dumper::Indent = 0; +$Data::Dumper::Terse = 1; +$Data::Dumper::Sortkeys = 1; +$Data::Dumper::Pair = ','; +$Data::Dumper::Useqq = 1; +$Data::Dumper::Indent = 0; +$Data::Dumper::Quotekeys = 1; while () { next unless /^([<>\+*])\s*(.*?)\s*0x([0-9a-f]+)$/; @@ -69,7 +72,7 @@ + 100 0x1864 + 1000 0x1903e8 + 1000000 0x1a000f4240 -+ 1000000000000 0x1b000000e8d4a51000 + 1000000000000 0x1b000000e8d4a51000 18446744073709551615 0x1bffffffffffffffff 18446744073709551616 0xc249010000000000000000 -18446744073709551616 0x3bffffffffffffffff @@ -81,16 +84,16 @@ < 0 0xf90000 -0 0xf98000 < 1 0xf93c00 -+ 1.1 0xfb3ff199999999999a +* 1.1 0xfb3ff199999999999a < 1.5 0xf93e00 < 65504 0xf97bff < 100000 0xfa47c35000 * 3.4028234663852886e+38 0xfa7f7fffff -+ 1e+300 0xfb7e37e43c8800759c +* 1e+300 0xfb7e37e43c8800759c 5.960464477539063e-8 0xf90001 0.00006103515625 0xf90400 < -4 0xf9c400 -+ -4.1 0xfbc010666666666666 +* -4.1 0xfbc010666666666666 Infinity 0xf97c00 NaN 0xf97e00 -Infinity 0xf9fc00 @@ -103,19 +106,19 @@ * false 0xf4 * true 0xf5 * null 0xf6 - undefined 0xf7 +* undefined 0xf7 simple(16) 0xf0 simple(24) 0xf818 simple(255) 0xf8ff 0("2013-03-21T20:04:00Z") 0xc074323031332d30332d32315432303a30343a30305a - 1(1363896240) 0xc11a514b67b0 - 1(1363896240.5) 0xc1fb41d452d9ec200000 +* 1(1363896240) 0xc11a514b67b0 +* 1(1363896240.5) 0xc1fb41d452d9ec200000 23(h'01020304') 0xd74401020304 - 24(h'6449455446') 0xd818456449455446 +* 24(h'6449455446') 0xd818456449455446 32("http://www.example.com") 0xd82076687474703a2f2f7777772e6578616d706c652e636f6d - h'' 0x40 - h'01020304' 0x4401020304 - "" 0x60 +* h'' 0x40 +* h'01020304' 0x4401020304 +* "" 0x60 + a 0x6161 + IETF 0x6449455446 + "\ 0x62225c