summaryrefslogtreecommitdiff
path: root/ext/XS
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2003-11-21 23:15:47 +0000
committerNicholas Clark <nick@ccl4.org>2003-11-21 23:15:47 +0000
commit8829b5e274708a88ac8ad69b61a45a9d67695db5 (patch)
tree4d0a3d1bfe20421e5fa86f275c8c2539f5c6b697 /ext/XS
parentcd6d36ac47e470799713a2a497ee38c219c3cf23 (diff)
downloadperl-8829b5e274708a88ac8ad69b61a45a9d67695db5.tar.gz
Check that the key is present before a delete, and absent afterwards
p4raw-id: //depot/perl@21767
Diffstat (limited to 'ext/XS')
-rw-r--r--ext/XS/APItest/t/hash.t8
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/XS/APItest/t/hash.t b/ext/XS/APItest/t/hash.t
index 2d3f19d4b6..5c6398a47d 100644
--- a/ext/XS/APItest/t/hash.t
+++ b/ext/XS/APItest/t/hash.t
@@ -145,10 +145,18 @@ sub test_delete_present {
tie %$copy, ref $class;
}
$copy = {%$hash};
+ ok (brute_force_exists ($copy, $key),
+ "hv_delete_ent present$message $printable");
is (delete $copy->{$key}, $key, "hv_delete_ent present$message $printable");
+ ok (!brute_force_exists ($copy, $key),
+ "hv_delete_ent present$message $printable");
$copy = {%$hash};
+ ok (brute_force_exists ($copy, $key),
+ "hv_delete present$message $printable");
is (XS::APItest::Hash::delete ($copy, $key), $key,
"hv_delete present$message $printable");
+ ok (!brute_force_exists ($copy, $key),
+ "hv_delete present$message $printable");
}
sub test_delete_absent {