diff options
author | Nicholas Clark <nick@ccl4.org> | 2003-11-21 23:15:47 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2003-11-21 23:15:47 +0000 |
commit | 8829b5e274708a88ac8ad69b61a45a9d67695db5 (patch) | |
tree | 4d0a3d1bfe20421e5fa86f275c8c2539f5c6b697 /ext/XS | |
parent | cd6d36ac47e470799713a2a497ee38c219c3cf23 (diff) | |
download | perl-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.t | 8 |
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 { |