Skip to content

Commit 49bc8c2

Browse files
committed
test implicit anchors using re.pm [perl #125810]
1 parent 02853b7 commit 49bc8c2

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

t/re/speed.t

+17-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ BEGIN {
2323
skip_all_without_unicode_tables();
2424
}
2525

26-
plan tests => 25; # Update this when adding/deleting tests.
26+
plan tests => 57; # Update this when adding/deleting tests.
2727

2828
use strict;
2929
use warnings;
@@ -118,6 +118,22 @@ sub run_tests {
118118
ok ($s !~ /.*?:::\s*ab/si, 'PREGf_IMPLICIT/si');
119119
ok ($s !~ /.*?:::\s*ab/ms, 'PREGf_IMPLICIT/ms');
120120
ok ($s !~ /.*?:::\s*ab/msi,'PREGf_IMPLICIT/msi');
121+
122+
for my $star ('*', '{0,}') {
123+
for my $greedy ('', '?') {
124+
for my $flags ('', 'i', 'm', 'mi') {
125+
for my $s ('', 's') {
126+
my $XBOL = $s ? 'SBOL' : 'MBOL';
127+
my $text = "anchored($XBOL) implicit";
128+
fresh_perl_like(<<"PROG", qr/\b\Q$text\E\b/, {}, "/.${star}${greedy}X/${flags}${s} anchors implicitly");
129+
BEGIN { \@INC = ('../lib', '.', '../ext/re'); }
130+
use re 'debug';
131+
qr/.${star}${greedy}:::\\s*ab/${flags}${s}
132+
PROG
133+
}
134+
}
135+
}
136+
}
121137
}
122138

123139
} # End of sub run_tests

0 commit comments

Comments
 (0)