Change 30088 by [EMAIL PROTECTED] on 2007/02/01 16:27:00
Make t/op/regexp.t run under use strict; including removing the
vestiges of change 1195 not removed by change 1244.
Affected files ...
... //depot/perl/t/op/re_tests#115 edit
... //depot/perl/t/op/regexp.t#40 edit
Differences ...
==== //depot/perl/t/op/re_tests#115 (text) ====
Index: perl/t/op/re_tests
--- perl/t/op/re_tests#114~29923~ 2007-01-22 11:39:28.000000000 -0800
+++ perl/t/op/re_tests 2007-02-01 08:27:00.000000000 -0800
@@ -497,7 +497,7 @@
a(?{"{"})b - c - Sequence (?{...}) not terminated or not
{}-balanced
a(?{"\{"})b cabd y $& ab
a(?{"{"}})b - c - Unmatched right curly bracket
-a(?{$bl="\{"}).b caxbd y $bl {
+a(?{$::bl="\{"}).b caxbd y $::bl {
x(~~)*(?:(?:F)?)? x~~ y - -
^a(?#xxx){3}c aaac y $& aaac
'^a (?#xxx) (?#yyy) {3}c'x aaac y $& aaac
==== //depot/perl/t/op/regexp.t#40 (xtext) ====
Index: perl/t/op/regexp.t
--- perl/t/op/regexp.t#39~29831~ 2007-01-15 08:26:17.000000000 -0800
+++ perl/t/op/regexp.t 2007-02-01 08:27:00.000000000 -0800
@@ -41,6 +41,9 @@
chdir 't' if -d 't';
@INC = '../lib';
}
+use strict;
+use vars qw($iters $numtests $bang $ffff $nulnul $OP);
+use vars qw($qr $skip_amp $qr_embed); # set by our callers
$iters = shift || 1; # Poor man performance suite, 10000 is OK.
@@ -68,22 +71,21 @@
}
chomp;
s/\\n/\n/g;
- ($pat, $subject, $result, $repl, $expect, $reason) = split(/\t/,$_,6);
- $input = join(':',$pat,$subject,$result,$repl,$expect);
- infty_subst(\$pat);
- infty_subst(\$expect);
+ my ($pat, $subject, $result, $repl, $expect, $reason) = split(/\t/,$_,6);
+ my $input = join(':',$pat,$subject,$result,$repl,$expect);
$pat = "'$pat'" unless $pat =~ /^[:'\/]/;
$pat =~ s/(\$\{\w+\})/$1/eeg;
$pat =~ s/\\n/\n/g;
$subject = eval qq("$subject");
$expect = eval qq("$expect");
$expect = $repl = '-' if $skip_amp and $input =~ /\$[&\`\']/;
- $skip = ($skip_amp ? ($result =~ s/B//i) : ($result =~ s/B//));
+ my $skip = ($skip_amp ? ($result =~ s/B//i) : ($result =~ s/B//));
$reason = 'skipping $&' if $reason eq '' && $skip_amp;
$result =~ s/B//i unless $skip;
- for $study ('', 'study $subject') {
- $c = $iters;
+ for my $study ('', 'study $subject') {
+ my $c = $iters;
+ my ($code, $match, $got);
if ($repl eq 'pos') {
$code= <<EOFCODE;
$study;
@@ -103,12 +105,12 @@
else {
$code= <<EOFCODE;
$study;
- \$match = (\$subject =~ $OP$pat$addg) while \$c--;
+ \$match = (\$subject =~ $OP$pat) while \$c--;
\$got = "$repl";
EOFCODE
}
eval $code;
- chomp( $err = $@ );
+ chomp( my $err = $@ );
if ($result eq 'c') {
if ($err !~ m!^\Q$expect!) { print "not ok $. (compile) $input =>
`$err'\n"; next TEST }
last; # no need to study a syntax error
@@ -142,11 +144,3 @@
}
close(TESTS);
-
-sub infty_subst # Special-case substitution
-{ # of $reg_infty and friends
- my $tp = shift;
- $$tp =~ s/,\$reg_infty_m}/,$reg_infty_m}/o;
- $$tp =~ s/,\$reg_infty_p}/,$reg_infty_p}/o;
- $$tp =~ s/,\$reg_infty}/,$reg_infty}/o;
-}
End of Patch.