{
my %h = (a=>'cheat');
tie %h, 'Tie::StdHash';
- is (XS::APItest::Hash::store(\%h, chr 258, 1), 1);
+ is (XS::APItest::Hash::store(\%h, chr 258, 1), undef);
ok (!exists $h{$utf8_for_258},
"hv_store doesn't insert a key with the raw utf8 on a tied hash");
if (defined $class) {
tie %h1, ref $class;
tie %h2, ref $class;
- $HV_STORE_IS_CRAZY = undef unless @$defaults;
+ $HV_STORE_IS_CRAZY = undef;
}
- is (XS::APItest::Hash::store_ent(\%h1, $key, 1), 1,
+ is (XS::APItest::Hash::store_ent(\%h1, $key, 1), $HV_STORE_IS_CRAZY,
"hv_store_ent$message $printable");
ok (brute_force_exists (\%h1, $key), "hv_store_ent$message $printable");
is (XS::APItest::Hash::store(\%h2, $key, 1), $HV_STORE_IS_CRAZY,
print $x | $y;
EXPECT
10
+########
+# Bug 36267
+sub TIEHASH { bless {}, $_[0] }
+sub STORE { $_[0]->{$_[1]} = $_[2] }
+sub FIRSTKEY { my $a = scalar keys %{$_[0]}; each %{$_[0]} }
+sub NEXTKEY { each %{$_[0]} }
+sub DELETE { delete $_[0]->{$_[1]} }
+sub CLEAR { %{$_[0]} = () }
+$h{b}=1;
+delete $h{b};
+print scalar keys %h, "\n";
+tie %h, 'main';
+$i{a}=1;
+%h = %i;
+untie %h;
+print scalar keys %h, "\n";
+EXPECT
+0
+0