summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2023-03-09 10:13:31 +0100
committerYves Orton <demerphq@gmail.com>2023-03-13 21:26:08 +0800
commitbed264fb59f3f5945dea7f8a1670254c0d59f58c (patch)
tree3c02a25ebb3faa1825eba651c51fa9fa189aea61 /t
parent1ee51d7ef248366649de1c50dafe89b2a2fa7cbb (diff)
downloadperl-bed264fb59f3f5945dea7f8a1670254c0d59f58c.tar.gz
t/re/regexp.t - in skip_amp tests (via _noamp.t) do not TODO tests with ampersand
Tests with $& always pass in regexp_noamp.t (wrapper around regexp.t), so when they are TODO tests it looks like a TODO pass when in fact it is just an artifact of how we handle ampersand tests in this file. For these cases we simply do not mark them as TODO anymore
Diffstat (limited to 't')
-rw-r--r--t/re/regexp.t5
1 files changed, 3 insertions, 2 deletions
diff --git a/t/re/regexp.t b/t/re/regexp.t
index e536429e85..731519135c 100644
--- a/t/re/regexp.t
+++ b/t/re/regexp.t
@@ -181,7 +181,8 @@ foreach (@tests) {
convert_from_ascii(\$expect);
$expect = eval qq("$expect"); die $@ if $@;
- $expect = $repl = '-' if $skip_amp and $input =~ /\$[&\`\']/;
+ my $has_amp = $input =~ /\$[&\`\']/;
+ $expect = $repl = '-' if $skip_amp and $has_amp;
my $todo_qr = $qr_embed_thr && ($result =~ s/t//);
my $skip = ($skip_amp ? ($result =~ s/B//i) : ($result =~ s/B//));
@@ -218,7 +219,7 @@ foreach (@tests) {
}
$reason = 'skipping $&' if $reason eq '' && $skip_amp;
$result =~ s/B//i unless $skip;
- my $todo= $result =~ s/T// ? " # TODO" : "";
+ my $todo= ($result =~ s/T// && (!$skip_amp || !$has_amp)) ? " # TODO" : "";
my $testname= $test_num;
if ($comment) {
$comment=~s/^\s*(?:#\s*)?//;