diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-12-07 14:44:27 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-12-07 14:44:27 +0000 |
commit | 9d021ad4f2bddaf5f0cd07d1c565a2ebdc9f4d6d (patch) | |
tree | b57905f2250f767a4980a9fe43701ef9e4bdb520 /dist | |
parent | 06e8058f27e4269b951baba5323da7760787ddf3 (diff) | |
download | perl-9d021ad4f2bddaf5f0cd07d1c565a2ebdc9f4d6d.tar.gz |
Uncomment and fix up tests at the end of Storable's blessed.t
These tests have never been "live", having been added, commented out, in 2004
as part of 754c00caaffe2ec6. The trick to make them work is to delete from the
symbol table, rather than merely attempting to undefine the subroutine.
Diffstat (limited to 'dist')
-rw-r--r-- | dist/Storable/t/blessed.t | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/dist/Storable/t/blessed.t b/dist/Storable/t/blessed.t index 7c0494c840..657d23f43f 100644 --- a/dist/Storable/t/blessed.t +++ b/dist/Storable/t/blessed.t @@ -27,7 +27,7 @@ use Storable qw(freeze thaw); ); my $test = 12; -my $tests = $test + 6 + 2 * 6 * keys %::immortals; +my $tests = $test + 10 + 2 * 6 * keys %::immortals; print "1..$tests\n"; package SHORT_NAME; @@ -183,13 +183,11 @@ 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'; +delete $INC{"HAS_HOOK.pm"}; +delete $HAS_HOOK::{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'; |