--- CBOR-XS/t/51_types.t 2013/10/28 15:37:11 1.2 +++ CBOR-XS/t/51_types.t 2013/11/30 17:19:34 1.3 @@ -1,4 +1,4 @@ -BEGIN { $| = 1; print "1..11\n"; } +BEGIN { $| = 1; print "1..21\n"; } use Types::Serialiser; use CBOR::XS; @@ -31,3 +31,31 @@ $dec = decode_cbor $enc; print !defined $dec ? "" : "not ", "ok 11\n"; +my $c = CBOR::XS->new->allow_sharing; + +$enc = $c->encode (Types::Serialiser::false); +print $enc ne "\xf4" ? "not " : "", "ok 12\n"; + +$dec = $c->decode ($enc); +print Types::Serialiser::is_false $dec ? "" : "not ", "ok 13\n"; +print Types::Serialiser::is_bool $dec ? "" : "not ", "ok 14\n"; + +$enc = $c->encode (Types::Serialiser::true); +print $enc ne "\xf5" ? "not " : "", "ok 15\n"; + +$dec = $c->decode ($enc); +print Types::Serialiser::is_true $dec ? "" : "not ", "ok 16\n"; +print Types::Serialiser::is_bool $dec ? "" : "not ", "ok 17\n"; + +$enc = $c->encode (Types::Serialiser::error); +print $enc ne "\xf7" ? "not " : "", "ok 18\n"; + +$dec = $c->decode ($enc); +print Types::Serialiser::is_error $dec ? "" : "not ", "ok 19\n"; + +$enc = $c->encode (undef); +print $enc ne "\xf6" ? "not " : "", "ok 20\n"; + +$dec = $c->decode ($enc); +print !defined $dec ? "" : "not ", "ok 21\n"; +