ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/CBOR-XS/t/58_hv.t
(Generate patch)

Comparing CBOR-XS/t/58_hv.t (file contents):
Revision 1.1 by root, Sun Apr 24 13:15:19 2016 UTC vs.
Revision 1.2 by root, Sun Apr 24 19:31:56 2016 UTC

1BEGIN { $| = 1; print "1..16\n"; } 1BEGIN { $| = 1; print "1..18\n"; }
2 2
3# none of the other tests serialise hv's, gross 3# none of the other tests serialise hv's, gross
4# also checks utf8_strings 4# also checks utf8_strings
5 5
6use CBOR::XS; 6use CBOR::XS;
47print $enc ne (pack "H*", "a1617ff6") ? "not " : "", "ok 14\n"; 47print $enc ne (pack "H*", "a1617ff6") ? "not " : "", "ok 14\n";
48 48
49$enc = $utf8_strings->encode ({ "\x{8f}" => undef }); 49$enc = $utf8_strings->encode ({ "\x{8f}" => undef });
50print $enc ne (pack "H*", "a162c28ff6") ? "not " : "", "ok 15\n"; 50print $enc ne (pack "H*", "a162c28ff6") ? "not " : "", "ok 15\n";
51 51
52$enc = $utf8_strings->encode ({ "\x{8f}gix\x{ff}x" => undef });
53print $enc ne (pack "H*", "a168c28f676978c3bf78f6") ? "not " : "", "ok 16\n";
54
55$dec = decode_cbor pack "H*", "a168c28f676978c3bf78f6";
56print +(keys %$dec)[0] ne "\x{8f}gix\x{ff}x" ? "not " : "", "ok 17\n";
57
52print "ok 16\n"; 58print "ok 18\n";
59

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines