1 |
BEGIN { $| = 1; print "1..11\n"; } |
2 |
|
3 |
use Types::Serialiser; |
4 |
use CBOR::XS; |
5 |
|
6 |
print "ok 1\n"; |
7 |
|
8 |
$enc = encode_cbor Types::Serialiser::false; |
9 |
print $enc ne "\xf4" ? "not " : "", "ok 2\n"; |
10 |
|
11 |
$dec = decode_cbor $enc; |
12 |
print Types::Serialiser::is_false $dec ? "" : "not ", "ok 3\n"; |
13 |
print Types::Serialiser::is_bool $dec ? "" : "not ", "ok 4\n"; |
14 |
|
15 |
$enc = encode_cbor Types::Serialiser::true; |
16 |
print $enc ne "\xf5" ? "not " : "", "ok 5\n"; |
17 |
|
18 |
$dec = decode_cbor $enc; |
19 |
print Types::Serialiser::is_true $dec ? "" : "not ", "ok 6\n"; |
20 |
print Types::Serialiser::is_bool $dec ? "" : "not ", "ok 7\n"; |
21 |
|
22 |
$enc = encode_cbor Types::Serialiser::error; |
23 |
print $enc ne "\xf7" ? "not " : "", "ok 8\n"; |
24 |
|
25 |
$dec = decode_cbor $enc; |
26 |
print Types::Serialiser::is_error $dec ? "" : "not ", "ok 9\n"; |
27 |
|
28 |
$enc = encode_cbor undef; |
29 |
print $enc ne "\xf6" ? "not " : "", "ok 10\n"; |
30 |
|
31 |
$dec = decode_cbor $enc; |
32 |
print !defined $dec ? "" : "not ", "ok 11\n"; |
33 |
|