I wonder how many other things a604c75 broke....
}
use strict;
-use Test::More tests => 16;
+use Test::More tests => 17;
BEGIN { use_ok('fields'); }
is(ref $x, 'Test::FooBar', 'x is a Test::FooBar');
ok(exists $x->{a}, 'x has a');
ok(exists $x->{b}, 'x has b');
+
+ SKIP: {
+ skip "This test triggers a perl bug", 1 if $] < 5.014001;
+ $x->{a} = __PACKAGE__;
+ ok eval { delete $x->{a}; 1 }, 'deleting COW values';
+ }
}
Safefree(key);
return NULL;
}
- if (SvREADONLY(hv) && HeVAL(entry) && SvREADONLY(HeVAL(entry))) {
+ if (SvREADONLY(hv) && HeVAL(entry) && SvREADONLY(HeVAL(entry))
+ && !SvIsCOW(HeVAL(entry))) {
hv_notallowed(k_flags, key, klen,
"Attempt to delete readonly key '%"SVf"' from"
" a restricted hash");