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

Comparing CBOR-XS/t/51_types.t (file contents):
Revision 1.2 by root, Mon Oct 28 15:37:11 2013 UTC vs.
Revision 1.3 by root, Sat Nov 30 17:19:34 2013 UTC

1BEGIN { $| = 1; print "1..11\n"; } 1BEGIN { $| = 1; print "1..21\n"; }
2 2
3use Types::Serialiser; 3use Types::Serialiser;
4use CBOR::XS; 4use CBOR::XS;
5 5
6print "ok 1\n"; 6print "ok 1\n";
29print $enc ne "\xf6" ? "not " : "", "ok 10\n"; 29print $enc ne "\xf6" ? "not " : "", "ok 10\n";
30 30
31$dec = decode_cbor $enc; 31$dec = decode_cbor $enc;
32print !defined $dec ? "" : "not ", "ok 11\n"; 32print !defined $dec ? "" : "not ", "ok 11\n";
33 33
34my $c = CBOR::XS->new->allow_sharing;
35
36$enc = $c->encode (Types::Serialiser::false);
37print $enc ne "\xf4" ? "not " : "", "ok 12\n";
38
39$dec = $c->decode ($enc);
40print Types::Serialiser::is_false $dec ? "" : "not ", "ok 13\n";
41print Types::Serialiser::is_bool $dec ? "" : "not ", "ok 14\n";
42
43$enc = $c->encode (Types::Serialiser::true);
44print $enc ne "\xf5" ? "not " : "", "ok 15\n";
45
46$dec = $c->decode ($enc);
47print Types::Serialiser::is_true $dec ? "" : "not ", "ok 16\n";
48print Types::Serialiser::is_bool $dec ? "" : "not ", "ok 17\n";
49
50$enc = $c->encode (Types::Serialiser::error);
51print $enc ne "\xf7" ? "not " : "", "ok 18\n";
52
53$dec = $c->decode ($enc);
54print Types::Serialiser::is_error $dec ? "" : "not ", "ok 19\n";
55
56$enc = $c->encode (undef);
57print $enc ne "\xf6" ? "not " : "", "ok 20\n";
58
59$dec = $c->decode ($enc);
60print !defined $dec ? "" : "not ", "ok 21\n";
61

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines