From: Bram Date: Tue, 5 Aug 2008 19:58:00 +0000 (+0200) Subject: Tests for [perl #57564] and [perl #24524] Refcounting bug X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fcf99ed44dc650ba48499b5fd6e385a04afd0979;p=p5sagit%2Fp5-mst-13.2.git Tests for [perl #57564] and [perl #24524] Refcounting bug Message-ID: <20080805195800.xq9k9kttwk0kwsk0@horde.wizbit.be> p4raw-id: //depot/perl@34171 --- diff --git a/t/op/ref.t b/t/op/ref.t index e3d66dc..9ef7b7a 100755 --- a/t/op/ref.t +++ b/t/op/ref.t @@ -8,7 +8,7 @@ BEGIN { require 'test.pl'; use strict qw(refs subs); -plan(182); +plan(189); # Test glob operations. @@ -584,6 +584,18 @@ ok (!eval { %$pvbm }, 'PVBM is not a HASH ref'); ok (!eval { $pvbm->() }, 'PVBM is not a CODE ref'); ok (!eval { $rpvbm->foo }, 'PVBM is not an object'); +# bug 24254 +is( runperl(stderr => 1, prog => 'map eval qq(exit),1 for 1'), ""); +is( runperl(stderr => 1, prog => 'eval { for (1) { map { die } 2 } };'), ""); +is( runperl(stderr => 1, prog => 'for (125) { map { exit } (213)}'), ""); +is( runperl(stderr => 1, prog => 'map die,4 for 3'), "Died at -e line 1.\n"); +is( runperl(stderr => 1, prog => 'grep die,4 for 3'), "Died at -e line 1.\n"); +is( runperl(stderr => 1, prog => 'for $a (3) {@b=sort {die} 4,5}'), "Died at -e line 1.\n"); + +# bug 57564 +is( runperl(stderr => 1, prog => 'my $i;for $i (1) { for $i (2) { } }'), ""); + + # Bit of a hack to make test.pl happy. There are 3 more tests after it leaves. $test = curr_test(); curr_test($test + 3);