Fix a Storable test to work in 5.8.9-
authorFather Chrysostomos <sprout@cpan.org>
Mon, 11 Jul 2011 20:10:03 +0000 (13:10 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 11 Jul 2011 20:13:56 +0000 (13:13 -0700)
This test only passes in 5.10.0+ because of a nasty bug in Hash::Util,
or perhaps Internals::SvREADONLY.

lock_hash is supposed to lock values as well as keys, but it doesn’t
always in 5.10.0+, leading me to believe that it was the right func-
tion to use.  (Fixing that is for another commit.)

dist/Storable/Storable.pm
dist/Storable/t/restrict.t

index 78ff0b6..a742438 100644 (file)
@@ -21,7 +21,7 @@ package Storable; @ISA = qw(Exporter);
 
 use vars qw($canonical $forgive_me $VERSION);
 
-$VERSION = '2.29';
+$VERSION = '2.30';
 
 BEGIN {
     if (eval { local $SIG{__DIE__}; require Log::Agent; 1 }) {
index a82c13d..65dac6f 100644 (file)
@@ -35,7 +35,7 @@ sub BEGIN {
 
 
 use Storable qw(dclone freeze thaw);
-use Hash::Util qw(lock_hash unlock_value);
+use Hash::Util qw(lock_hash unlock_value lock_keys);
 use Test::More tests => 104;
 
 my %hash = (question => '?', answer => 42, extra => 'junk', undef => undef);
@@ -113,7 +113,7 @@ for $Storable::canonical (0, 1) {
 
     my %hv;
     $hv{a} = __PACKAGE__;
-    lock_hash %hv;
+    lock_keys %hv;
     my $hv2 = &$cloner(\%hv);
     ok eval { $$hv2{a} = 70 }, 'COWs do not become read-only';
   }