summaryrefslogtreecommitdiff
path: root/ext/Hash
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-09-19 08:12:09 +0000
committerNicholas Clark <nick@ccl4.org>2007-09-19 08:12:09 +0000
commitb54b4831042e3002a143d3fcff13b3bad5088c70 (patch)
tree27aa8960a156889eaaaf419ba915c98f63217bf0 /ext/Hash
parent821f5ffa2f9d60b548dcc3fae13ebf47b1875d04 (diff)
downloadperl-b54b4831042e3002a143d3fcff13b3bad5088c70.tar.gz
For an LVALUE fetch, "hv_fetch()" will recurse into "hv_store()" for a
hash with magic. Field hashes have u magic, so this recursion triggers. However, key conversion replaces the original key with the converted key, so we need to ensure that conversion happens exactly once, else for a non-idempotent key conversion routine (eg ROT13) we will see double conversion in this case. p4raw-id: //depot/perl@31898
Diffstat (limited to 'ext/Hash')
-rw-r--r--ext/Hash/Util/FieldHash/t/05_perlhook.t30
1 files changed, 15 insertions, 15 deletions
diff --git a/ext/Hash/Util/FieldHash/t/05_perlhook.t b/ext/Hash/Util/FieldHash/t/05_perlhook.t
index 9901e81443..dd61540969 100644
--- a/ext/Hash/Util/FieldHash/t/05_perlhook.t
+++ b/ext/Hash/Util/FieldHash/t/05_perlhook.t
@@ -76,50 +76,50 @@ use Scalar::Util qw( weaken);
is( $counter, 1, "list assign triggers");
$h{ def} = 456;
- is( $counter, 3, "lvalue assign triggers twice");
+ is( $counter, 2, "lvalue assign triggers twice");
exists $h{ def};
- is( $counter, 4, "good exists triggers");
+ is( $counter, 3, "good exists triggers");
exists $h{ xyz};
- is( $counter, 5, "bad exists triggers");
+ is( $counter, 4, "bad exists triggers");
delete $h{ def};
- is( $counter, 6, "good delete triggers");
+ is( $counter, 5, "good delete triggers");
delete $h{ xyz};
- is( $counter, 7, "bad delete triggers");
+ is( $counter, 6, "bad delete triggers");
my $x = $h{ abc};
- is( $counter, 8, "good read triggers");
+ is( $counter, 7, "good read triggers");
$x = $h{ xyz};
- is( $counter, 9, "bad read triggers");
+ is( $counter, 8, "bad read triggers");
bless \ %h;
- is( $counter, 9, "bless triggers(!)");
+ is( $counter, 8, "bless triggers(!)"); # XXX, this description seems bogus
$x = keys %h;
- is( $counter, 9, "scalar keys doesn't trigger");
+ is( $counter, 8, "scalar keys doesn't trigger");
() = keys %h;
- is( $counter, 9, "list keys doesn't trigger");
+ is( $counter, 8, "list keys doesn't trigger");
$x = values %h;
- is( $counter, 9, "scalar values doesn't trigger");
+ is( $counter, 8, "scalar values doesn't trigger");
() = values %h;
- is( $counter, 9, "list values doesn't trigger");
+ is( $counter, 8, "list values doesn't trigger");
$x = each %h;
- is( $counter, 9, "scalar each doesn't trigger");
+ is( $counter, 8, "scalar each doesn't trigger");
() = each %h;
- is( $counter, 9, "list each doesn't trigger");
+ is( $counter, 8, "list each doesn't trigger");
bless \ %h, 'xyz';
- is( $counter, 9, "bless doesn't trigger");
+ is( $counter, 8, "bless doesn't trigger");
# see that normal set magic doesn't trigger (identity condition)
my %i;