Revision: | 1.1 |
Committed: | Fri Nov 22 15:28:38 2013 UTC (10 years, 7 months ago) by root |
Content type: | application/x-troff |
Branch: | MAIN |
Log Message: | *** empty log message *** |
# | User | Rev | Content |
---|---|---|---|
1 | root | 1.1 | BEGIN { $| = 1; print "1..4\n"; } |
2 | BEGIN { $^W = 0 } # hate | ||
3 | |||
4 | use CBOR::XS; | ||
5 | |||
6 | print "ok 1\n"; | ||
7 | |||
8 | my $t = decode_cbor pack "H*", "82c48221196ab3c5822003"; | ||
9 | |||
10 | print $t->[0] eq "273.15" ? "" : "not ", "ok 2 # $t->[0]\n"; | ||
11 | print $t->[1] eq "1.5" ? "" : "not ", "ok 3 # $t->[1]\n"; | ||
12 | |||
13 | $t = encode_cbor $t; | ||
14 | |||
15 | print $t eq (pack "H*", "82c48221196ab3c482200f") ? "" : "not ", "ok 4 # ", (unpack "H*", $t), "\n"; | ||
16 |