X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fop%2Fdelete.t;h=ac4405c4193e430121adcecb17bb9f37e6d07eb9;hb=69938bbac29d5bcb76b80f6eccb27c5ff84cee37;hp=10a218b1b6185f6f7427cf42453dbee0ccc24a00;hpb=146174a91a192983720a158796dc066226ad0e55;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/op/delete.t b/t/op/delete.t index 10a218b..ac4405c 100755 --- a/t/op/delete.t +++ b/t/op/delete.t @@ -1,6 +1,6 @@ #!./perl -print "1..36\n"; +print "1..38\n"; # delete() on hash elements @@ -121,3 +121,24 @@ print @{$refary[0]} == 1 ? "ok 35\n" : "not ok 35 @list\n"; print "not " unless $a == $b && $b == $c; print "ok 36\n"; } + +{ + # [perl #29127] scalar delete of empty slice returned garbage + my %h; + my ($x,$y) = (1, scalar delete @h{()}); + print "not " if defined $y; + print "ok 37\n"; +} + +{ + # [perl #30733] array delete didn't free returned element + my $x = 0; + sub X::DESTROY { $x++ } + { + my @a; + $a[0] = bless [], 'X'; + my $y = delete $a[0]; + } + print "not " unless $x == 1; + print "ok 38\n"; +}