diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-01-23 15:11:11 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-01-23 15:11:11 +0000 |
commit | 86f12da24a95dda38e6d599b881a5cca226226e4 (patch) | |
tree | 28292bf3ef849646ba78931cf63d1420d1648d87 /t | |
parent | 92e67595817e2efa2a2f6c3e6498b1f1babb5fbd (diff) | |
download | perl-86f12da24a95dda38e6d599b881a5cca226226e4.tar.gz |
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
Diffstat (limited to 't')
-rwxr-xr-x | t/op/pat.t | 38 | ||||
-rwxr-xr-x | t/op/taint.t | 2 |
2 files changed, 37 insertions, 3 deletions
diff --git a/t/op/pat.t b/t/op/pat.t index 2f71f8a7c3..004499f80d 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 4aab7374f9..3d333c840f 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"; } |