ext/Storable/README Storable extension
ext/Storable/Storable.pm Storable extension
ext/Storable/Storable.xs Storable extension
+ext/Storable/t/HAS_HOOK.pm For auto-requiring of modules for STORABLE_thaw
ext/Storable/t/blessed.t See if Storable works
ext/Storable/t/canonical.t See if Storable works
ext/Storable/t/code.t See if Storable works
+Wed Mar 17 15:40:29 GMT 2004 Nicholas Clark <nick@ccl4.org>
+
+ 1. Add regression tests for the auto-require of STORABLE_thaw
+
Sat Mar 13 20:11:03 GMT 2004 Nicholas Clark <nick@ccl4.org>
Version 2.11
Storable.xs The C side of Storable
ChangeLog Changes since baseline
hints/linux.pl Hint file to drop gcc to -O2
+t/HAS_HOOK.pm For auto-requiring of modules for STORABLE_thaw
t/blessed.t See if Storable works
t/canonical.t See if Storable works
t/code.t Test (de)serialization of code references
);
my $test = 12;
-my $tests = $test + 2 * 6 * keys %::immortals;
+my $tests = $test + 6 + 2 * 6 * keys %::immortals;
print "1..$tests\n";
package SHORT_NAME;
ok ++$test, 1;
}
}
+
+# Test automatic require of packages to find thaw hook.
+
+package HAS_HOOK;
+
+$loaded_count = 0;
+$thawed_count = 0;
+
+sub make {
+ bless [];
+}
+
+sub STORABLE_freeze {
+ my $self = shift;
+ return '';
+}
+
+package main;
+
+my $f = freeze (HAS_HOOK->make);
+
+ok ++$test, $HAS_HOOK::loaded_count == 0;
+ok ++$test, $HAS_HOOK::thawed_count == 0;
+
+my $t = thaw $f;
+ok ++$test, $HAS_HOOK::loaded_count == 1;
+ok ++$test, $HAS_HOOK::thawed_count == 1;
+ok ++$test, $t;
+ok ++$test, ref $t eq 'HAS_HOOK';
+
+# Can't do this because the method is still cached by UNIVERSAL::can
+# delete $INC{"HAS_HOOK.pm"};
+# undef &HAS_HOOK::STORABLE_thaw;
+#
+# warn HAS_HOOK->can('STORABLE_thaw');
+# $t = thaw $f;
+# ok ++$test, $HAS_HOOK::loaded_count == 2;
+# ok ++$test, $HAS_HOOK::thawed_count == 2;
+# ok ++$test, $t;
+# ok ++$test, ref $t eq 'HAS_HOOK';