1 | BEGIN { $| = 1; print "1..11\n"; } |
1 | BEGIN { $| = 1; print "1..16\n"; } |
2 | BEGIN { $^W = 0 } # hate |
2 | BEGIN { $^W = 0 } # hate |
3 | |
3 | |
4 | use CBOR::XS; |
4 | use CBOR::XS; |
|
|
5 | use Scalar::Util (); |
5 | |
6 | |
6 | print "ok 1\n"; |
7 | print "ok 1\n"; |
7 | |
8 | |
8 | sub CBOR::XS::freeze::FREEZE { 77 } |
9 | sub CBOR::XS::freeze::FREEZE { 77 } |
9 | sub CBOR::XS::freeze::THAW { \my $dummy } |
10 | sub CBOR::XS::freeze::THAW { \my $dummy } |
… | |
… | |
27 | $dec = CBOR::XS->new->allow_cycles->decode (pack "H*", "d81c81d81d00"); |
28 | $dec = CBOR::XS->new->allow_cycles->decode (pack "H*", "d81c81d81d00"); |
28 | |
29 | |
29 | print ARRAY:: eq ref $dec ? "" : "not ", "ok 9\n"; |
30 | print ARRAY:: eq ref $dec ? "" : "not ", "ok 9\n"; |
30 | print $dec == $dec->[0] ? "" : "not ", "ok 10\n"; |
31 | print $dec == $dec->[0] ? "" : "not ", "ok 10\n"; |
31 | |
32 | |
32 | print "ok 11\n"; |
33 | $dec = CBOR::XS->new->allow_weak_cycles->decode (pack "H*", "82d81c81d81d00d81d00"); |
33 | |
34 | |
|
|
35 | print $dec->[0] == $dec->[1] ? "" : "not ", "ok 11\n"; |
|
|
36 | print $dec->[0] == $dec->[0][0] ? "" : "not ", "ok 12\n"; |
|
|
37 | |
|
|
38 | print Scalar::Util::isweak $dec->[0] ? "not " : "", "ok 13\n"; |
|
|
39 | print Scalar::Util::isweak $dec->[1] ? "not " : "", "ok 14\n"; |
|
|
40 | print Scalar::Util::isweak $dec->[0][0] ? "" : "not ", "ok 15\n"; |
|
|
41 | |
|
|
42 | print "ok 16\n"; |
|
|
43 | |