diff options
author | Rick Delaney <rick@consumercontact.com> | 2005-07-14 16:10:00 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-07-18 09:17:45 +0000 |
commit | 28905b57f48ed7d8802e9adcef28d443eb2b6de4 (patch) | |
tree | 08c03d3a382cc1e3d0311ffb243844b9a247e5f5 /t | |
parent | 0d594e51e853b48a97327618a6e01007b612c5cd (diff) | |
download | perl-28905b57f48ed7d8802e9adcef28d443eb2b6de4.tar.gz |
Re: [perl #27028] /$/ not honouring /m in some cases
Message-ID: <20050714141059.GF19090@localhost.localdomain>
p4raw-id: //depot/perl@25166
Diffstat (limited to 't')
-rwxr-xr-x | t/op/regexp.t | 16 | ||||
-rw-r--r-- | t/op/regexp_qr_embed.t | 11 |
2 files changed, 26 insertions, 1 deletions
diff --git a/t/op/regexp.t b/t/op/regexp.t index b4288b2e66..662be92dab 100755 --- a/t/op/regexp.t +++ b/t/op/regexp.t @@ -74,7 +74,21 @@ while (<TESTS>) { $result =~ s/B//i unless $skip; for $study ('', 'study \$subject') { $c = $iters; - eval "$study; \$match = (\$subject =~ $OP$pat) while \$c--; \$got = \"$repl\";"; + if ($qr_embed) { + eval qq" + my \$RE = qr$pat; + $study; + \$match = (\$subject =~ /(?:)\$RE(?:)/) while \$c--; + \$got = \"$repl\"; + "; + } + else { + eval qq" + $study; + \$match = (\$subject =~ $OP$pat) while \$c--; + \$got = \"$repl\"; + "; + } chomp( $err = $@ ); if ($result eq 'c') { if ($err !~ m!^\Q$expect!) { print "not ok $. (compile) $input => `$err'\n"; next TEST } diff --git a/t/op/regexp_qr_embed.t b/t/op/regexp_qr_embed.t new file mode 100644 index 0000000000..bcd51156de --- /dev/null +++ b/t/op/regexp_qr_embed.t @@ -0,0 +1,11 @@ +#!./perl + +$qr = 1; +$qr_embed = 1; +for $file ('./op/regexp.t', './t/op/regexp.t', ':op:regexp.t') { + if (-r $file) { + do $file; + exit; + } +} +die "Cannot find ./op/regexp.t or ./t/op/regexp.t\n"; |