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

Comparing CBOR-XS/t/52_object.t (file contents):
Revision 1.2 by root, Mon Oct 28 22:50:50 2013 UTC vs.
Revision 1.9 by root, Sat Nov 30 18:13:53 2013 UTC

1BEGIN { $| = 1; print "1..20\n"; } 1BEGIN { $| = 1; print "1..20\n"; }
2BEGIN { $^W = 0 } # hate
2 3
3while(){
4use CBOR::XS; 4use CBOR::XS;
5 5
6print "ok 1\n"; 6print "ok 1\n";
7 7
8sub CBOR::XS::tocbor::TO_CBOR { 8sub CBOR::XS::tocbor::TO_CBOR {
39 777 39 777
40} 40}
41 41
42$obj = bless { k => 1 }, CBOR::XS::freeze::; 42$obj = bless { k => 1 }, CBOR::XS::freeze::;
43$enc = encode_cbor $obj; 43$enc = encode_cbor $obj;
44print $enc eq (pack "H*", "d90100845043424f523a3a58533a3a667265657a65030102") ? "" : "not ", "ok 12\n"; 44print $enc eq (pack "H*", "d81a845043424f523a3a58533a3a667265657a65030102") ? "" : "not ", "ok 12 ", (unpack "H*", $enc), "\n";
45 45
46$dec = decode_cbor $enc; 46$dec = decode_cbor $enc;
47print $dec eq 777 ? "" : "not ", "ok 19\n"; 47print $dec eq 777 ? "" : "not ", "ok 19\n";
48 48
49print "ok 20\n"; 49print "ok 20\n";
50}
51 50

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines