Skip to content

Commit

Permalink
Add a regex test for changes in 1d8aafa
Browse files Browse the repository at this point in the history
In https://groups.google.com/u/1/g/google-code/c/bn4X3d-89to, Neil
Agarwal wrote:

---

Could someone please explain to me the output of the following Perl
code in Code Jam's test run mode? The system gives "BCD" instead of
"ABCD", and I have not been able to reproduce this behavior anywhere
else.

$S1 = "1((((((7(9))))))";
$S2 = "1((((((7(9)))))";

print "A" if $S1 =~ /[89]+/;
print "B" if $S1 =~ /[9]+/;
print "C" if $S2 =~ /[89]+/;
print "D" if $S2 =~ /[9]+/;

---

I tried to bisect the problem and discovered the wrong behaviour was
introduced in 2813d4a and fixed in
1d8aafa, which means all 5.28.* had
this problem. Google Code Jam used 5.28.1 in the 2021 contest.

This commit adds the original test case to prevent further
regressions.
  • Loading branch information
choroba committed Apr 28, 2021
1 parent cc442aa commit 6c6de35
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions t/re/re_tests
Expand Up @@ -290,6 +290,7 @@ a[bcd]+dcdcde adcdcde n - -
((((((((((a))))))))))${bang} aa n - -
((((((((((a))))))))))${bang} a! y $& a!
(((((((((a))))))))) a y $& a
[89]+ 1((((((7(9)))))) y - -
multiple words of text uh-uh n - -
multiple words multiple words, yeah y $& multiple words
(.*)c(.*) abcde y $&-$1-$2 abcde-ab-de
Expand Down

0 comments on commit 6c6de35

Please sign in to comment.