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

Comparing CBOR-XS/t/54_sharing.t (file contents):
Revision 1.1 by root, Sat Nov 30 18:13:53 2013 UTC vs.
Revision 1.3 by root, Fri Sep 8 20:03:06 2023 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines