#!./perl
#
# Copyright (c) 1995-2000, Raphael Manfredi
#
# You may redistribute only under the same terms as Perl 5, as specified
# in the README file that comes with the distribution.
#
chdir('t') if -d 't';
} else {
}
print "1..0 # Skip: Storable was not built\n";
exit 0;
}
}
sub ok;
print "1..16\n";
use overload
'""' => sub { $_[0][0] };
$a = bless [77], OVERLOADED;
$d->[0][0]++;
sub make {
return $self;
}
use overload
sub plus {
return 314;
}
sub make {
return $self;
}
ok 9, $a + $a == 314;
ok 12, $b + $b == 314;
# nfreeze data generated by make_overload.pl
# see note at the end of do_retrieve in Storable.xs about why this test has to
# use a reference to an overloaded reference, rather than just a reference.
my $t = eval {thaw $f};
print "# $@" if $@;
ok 13, $@ eq "";
1;