From: Nicholas Clark Date: Mon, 23 Jan 2006 15:11:11 +0000 (+0000) Subject: Change the regression test added by 26410 to use test.pl; this makes X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=86f12da24a95dda38e6d599b881a5cca226226e4;p=p5sagit%2Fp5-mst-13.2.git Change the regression test added by 26410 to use test.pl; this makes it easier to TODO if needed. Add the TODO test provided by Rick Delaney, but not as TODO, because change 26410 also made pos on LVALUE subroutines work for the first time. p4raw-id: //depot/perl@26925 --- diff --git a/t/op/pat.t b/t/op/pat.t index 2f71f8a..004499f 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -6,7 +6,7 @@ $| = 1; -print "1..1196\n"; +print "1..1199\n"; BEGIN { chdir 't' if -d 't'; @@ -3435,4 +3435,38 @@ ok(("foba ba$s" =~ qr/(foo|BaSS|bar)/i) ok($@ eq "", "# TODO 26410 caused a regression") or print "# $@\n"; } -# last test 1196 +{ + sub gloople { + "!"; + } + eval {gloople() =~ /(.)/g;}; + ok($@ eq "", "# 26410 didn't affect sub calls for some reason") + or print "# $@\n"; +} + +{ + # Prior to change 26410 this did not work: + + package lv; + $var = "abc"; + sub variable : lvalue { $var } + + package main; + my $o = bless [], "lv"; + my $f = ""; + eval { for (1..2) { $f .= $1 if $o->variable =~ /(.)/g } }; + ok($f eq "ab", "# pos retained between calls") or print "# $@\n"; +} + +{ + # Prior to change 26410 this did not work: + + $var = "abc"; + sub variable : lvalue { $var } + + my $f = ""; + eval { for (1..2) { $f .= $1 if variable() =~ /(.)/g } }; + ok($f eq "ab", "# pos retained between calls") or print "# $@\n"; +} + +# last test 1199 diff --git a/t/op/taint.t b/t/op/taint.t index 4aab737..3d333c8 100755 --- a/t/op/taint.t +++ b/t/op/taint.t @@ -1145,7 +1145,7 @@ TERNARY_CONDITIONALS: { while($a[0]=~ m/(.)/g ) { last if $i++ > 10000; } - test $i < 10000, "infinite m//g"; + cmp_ok $i, '<', 10000, "infinite m//g"; }