3 # Copyright (c) 1995-2000, Raphael Manfredi
5 # You may redistribute only under the same terms as Perl 5, as specified
6 # in the README file that comes with the distribution.
12 @INC = ('.', '../lib', '../ext/Storable/t');
16 require Config; import Config;
17 if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) {
18 print "1..0 # Skip: Storable was not built\n";
26 use Storable qw(freeze thaw);
33 '""' => sub { $_[0][0] };
37 $a = bless [77], OVERLOADED;
40 ok 1, ref $b eq 'OVERLOADED';
44 ok 3, ref $c eq 'REF';
45 ok 4, ref $$c eq 'OVERLOADED';
48 $d = thaw freeze [$a, $a];
49 ok 6, "$d->[0]" eq "77";
51 ok 7, "$d->[1]" eq "78";
56 my $self = bless {}, shift;
58 $self->{over} = $over;
66 '""' => sub { ref $_[0] };
73 my $self = bless {}, shift;
74 my $ref = REF_TO_OVER->make($self);
84 ok 8, ref $b eq 'OVER';
86 ok 10, ref $b->{ref} eq 'REF_TO_OVER';
87 ok 11, "$b->{ref}->{over}" eq "$b";
88 ok 12, $b + $b == 314;