if ((svp = hv_fetchs(params, "hash_pv", 0))) {
PERL_HASH(hash, key, klen);
}
+ if ((svp = hv_fetchs(params, "hash_sv", 0))) {
+ STRLEN len;
+ const char *const p = SvPV(keysv, len);
+ PERL_HASH(hash, p, len);
+ }
result = (HE *)hv_common(hv, keysv, key, klen, flags, action, val, hash);
if (!result) {
my $as_bytes = "\243";
foreach my $key ('N', $as_bytes, $as_utf8, "\x{2623}") {
my $ord = ord $key;
- foreach my $hash_pv (0, 1) {
- my %hash;
- is (XS::APItest::Hash::common({hv => \%hash, keypv => $key,
- val => $ord, hash_pv => $hash_pv,
- action =>
- XS::APItest::HV_FETCH_ISSTORE}),
- $ord, "store $ord \$hash_pv = $hash_pv");
- is_deeply ([each %hash], [$key, $ord], "First key read is good");
- is_deeply ([each %hash], [], "No second key good");
-
- is ($hash{$key}, $ord, "Direct hash read finds $ord");
+ foreach my $hash_it (0, 1) {
+ foreach my $what (qw(pv sv)) {
+ my %hash;
+ is (XS::APItest::Hash::common({hv => \%hash,
+ "key$what" => $key,
+ val => $ord,
+ "hash_$what" => $hash_it,
+ action =>
+ XS::APItest::HV_FETCH_ISSTORE}),
+ $ord, "store $ord with $what \$hash_it = $hash_it");
+ is_deeply ([each %hash], [$key, $ord],
+ "First key read is good");
+ is_deeply ([each %hash], [], "No second key good");
+
+ is ($hash{$key}, $ord, "Direct hash read finds $ord");
+ }
}
}
}