From: Nicholas Clark Date: Fri, 21 Nov 2003 23:15:47 +0000 (+0000) Subject: Check that the key is present before a delete, and absent afterwards X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8829b5e274708a88ac8ad69b61a45a9d67695db5;p=p5sagit%2Fp5-mst-13.2.git Check that the key is present before a delete, and absent afterwards p4raw-id: //depot/perl@21767 --- diff --git a/ext/XS/APItest/t/hash.t b/ext/XS/APItest/t/hash.t index 2d3f19d..5c6398a 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 {