From: Rafael Garcia-Suarez Date: Wed, 1 Nov 2006 10:44:58 +0000 (+0000) Subject: Regression test by Yves Orton for : [perl #36046] Special var @- X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=581d1b5b4d97adf808d2c062f6d09ceb66f049ae;p=p5sagit%2Fp5-mst-13.2.git Regression test by Yves Orton for : [perl #36046] Special var @- becomes arbitrarily large p4raw-id: //depot/perl@29178 --- diff --git a/t/op/pat.t b/t/op/pat.t index 9bd6553..3cb8e8f 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -3839,6 +3839,17 @@ for my $c ("z", "\0", "!", chr(254), chr(256)) { ok(eval("qq/$targ/ =~ /$reg/"), "\\c\\ in pattern"); } +{ + my $str='abc'; + my $count=0; + my $mval=0; + my $pval=0; + while ($str=~/b/g) { $mval=$#-; $pval=$#+; $count++ } + iseq($mval,0,"\@- should be empty [RT#36046]"); + iseq($pval,0,"\@+ should be empty [RT#36046]"); + iseq($count,1,"should have matched once only [RT#36046]"); +} + # Keep the following tests last -- they may crash perl ok(("a" x (2**15 - 10)) =~ /^()(a|bb)*$/, "Recursive stack cracker: #24274") @@ -3849,5 +3860,5 @@ ok((q(a)x 100) =~ /^(??{'(.)'x 100})/, or print "# Unexpected outcome: should pass or crash perl\n"; # Don't forget to update this! -BEGIN{print "1..1284\n"}; +BEGIN{print "1..1287\n"};