Server : Apache System : Linux dedi-14684855.grupobig.com 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 User : grupo692 ( 1004) PHP Version : 8.2.31 Disable Function : NONE Directory : /home/.cpan/build/Storable-3.25-0/t/ |
#!./perl
use Test::More;
use Storable ();
BEGIN {
eval "use Test::LeakTrace";
plan 'skip_all' => 'Test::LeakTrace required for this tests' if $@;
}
plan 'tests' => 1;
{
my $c = My::Simple->new;
my $d;
my $freezed = Storable::freeze($c);
no_leaks_ok
{
$d = Storable::thaw($freezed);
undef $d;
};
package My::Simple;
sub new {
my ($class, $arg) = @_;
bless {t=>$arg}, $class;
}
sub STORABLE_freeze {
return "abcderfgh";
}
sub STORABLE_attach {
my ($class, $c, $serialized) = @_;
return $class->new($serialized);
}
}
{ # [cpan #97316]
package TestClass;
sub new {
my $class = shift;
return bless({}, $class);
}
sub STORABLE_freeze {
die;
}
package main;
my $obj = TestClass->new;
eval { freeze($obj); };
}