Lines Matching refs:key

55       "hv_store doesn't insert a key with the raw utf8 on a tied hash");
64 foreach my $key (@$testkeys) {
65 my $lckey = ($key eq chr 198) ? chr 230 : lc $key;
66 my $unikey = $key;
69 utf8::downgrade $key, 1;
72 main_test_inner ($key, $lckey, $unikey, $keys, $description);
74 utf8::upgrade $key;
77 main_test_inner ($key, $lckey, $unikey, $keys,
78 $description . ' [key utf8 on]');
81 # hv_exists was buggy for tied hashes, in that the raw utf8 key was being
90 my ($key, $lckey, $unikey, $keys, $description) = @_;
91 perform_test (\&test_present, $key, $keys, $description);
92 perform_test (\&test_fetch_present, $key, $keys, $description);
93 perform_test (\&test_delete_present, $key, $keys, $description);
95 perform_test (\&test_store, $key, $keys, $description, [a=>'cheat']);
96 perform_test (\&test_store, $key, $keys, $description, []);
102 return if $unikey eq $key;
110 my ($test_sub, $key, $keys, $message, @other) = @_;
111 my $printable = join ',', map {ord} split //, $key;
119 &$test_sub (\%hash, $key, $printable, $message, @other);
120 &$test_sub (\%tiehash, $key, $printable, "$message tie", @other);
124 my ($hash, $key, $printable, $message) = @_;
126 ok (exists $hash->{$key}, "hv_exists_ent present$message $printable");
127 ok (XS::APItest::Hash::exists ($hash, $key),
132 my ($hash, $key, $printable, $message) = @_;
134 ok (!exists $hash->{$key}, "hv_exists_ent absent$message $printable");
135 ok (!XS::APItest::Hash::exists ($hash, $key),
140 my ($hash, $key, $printable, $message) = @_;
148 ok (brute_force_exists ($copy, $key),
150 is (delete $copy->{$key}, $key, "hv_delete_ent present$message $printable");
151 ok (!brute_force_exists ($copy, $key),
154 ok (brute_force_exists ($copy, $key),
156 is (XS::APItest::Hash::delete ($copy, $key), $key,
158 ok (!brute_force_exists ($copy, $key),
163 my ($hash, $key, $printable, $message) = @_;
171 is (delete $copy->{$key}, undef, "hv_delete_ent absent$message $printable");
173 is (XS::APItest::Hash::delete ($copy, $key), undef,
178 my ($hash, $key, $printable, $message, $defaults) = @_;
193 is (XS::APItest::Hash::store_ent(\%h1, $key, 1), 1,
195 ok (brute_force_exists (\%h1, $key), "hv_store_ent$message $printable");
196 is (XS::APItest::Hash::store(\%h2, $key, 1), $HV_STORE_IS_CRAZY,
198 ok (brute_force_exists (\%h2, $key), "hv_store$message $printable");
202 my ($hash, $key, $printable, $message) = @_;
204 is ($hash->{$key}, $key, "hv_fetch_ent present$message $printable");
205 is (XS::APItest::Hash::fetch ($hash, $key), $key,
210 my ($hash, $key, $printable, $message) = @_;
212 is ($hash->{$key}, undef, "hv_fetch_ent absent$message $printable");
213 is (XS::APItest::Hash::fetch ($hash, $key), undef,
218 my ($hash, $key) = @_;
220 return 1 if $key eq $_;