From: Nicholas Clark Date: Thu, 1 Feb 2007 16:27:00 +0000 (+0000) Subject: Make t/op/regexp.t run under use strict; including removing the X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1286eaeb2de3949c39fce40ec1f0140e47e5abe6;p=p5sagit%2Fp5-mst-13.2.git Make t/op/regexp.t run under use strict; including removing the vestiges of change 1195 not removed by change 1244. p4raw-id: //depot/perl@30088 --- diff --git a/t/op/re_tests b/t/op/re_tests index fca6b11..e2b33fb 100644 --- a/t/op/re_tests +++ b/t/op/re_tests @@ -497,7 +497,7 @@ a(?{}})b - c - 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 diff --git a/t/op/regexp.t b/t/op/regexp.t index a7cd5fc..f416f29 100755 --- a/t/op/regexp.t +++ b/t/op/regexp.t @@ -41,6 +41,9 @@ BEGIN { 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 @@ while () { } 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= < `$err'\n"; next TEST } last; # no need to study a syntax error @@ -142,11 +144,3 @@ EOFCODE } 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; -}