Wrong skip count in t/op/stash.t
[p5sagit/p5-mst-13.2.git] / t / op / pat.t
old mode 100755 (executable)
new mode 100644 (file)
index 88fbe5d..aa6299f
@@ -13,7 +13,7 @@ sub run_tests;
 
 $| = 1;
 
-my $EXPECTED_TESTS = 4061;  # Update this when adding/deleting tests.
+my $EXPECTED_TESTS = 4065;  # Update this when adding/deleting tests.
 
 BEGIN {
     chdir 't' if -d 't';
@@ -4143,6 +4143,8 @@ sub run_tests {
 
         my $c = 0;
         for my $test (
+            # Test structure:
+            #  [ Expected result, Regex, Expected value(s) of $^N, Expected value(s) of $+ ]
             [ 1, qr#^$nested_tags$#, "bla blubb bla", "a b a" ],
             [ 1, qr#^($nested_tags)$#, "bla blubb <bla><blubb></blubb></bla>", "a b a" ],
             [ 1, qr#^(|)$nested_tags$#, "bla blubb bla", "a b a" ],
@@ -4199,6 +4201,14 @@ sub run_tests {
         my $re8 = qr/(\d+)/;
         my $c = 0;
         for my $test (
+             # Test structure:
+             #  [
+             #    String to match
+             #    Regex too match
+             #    Expected values of $^N
+             #    Expected values of $+
+             #    Expected values of $1, $2, $3, $4 and $5
+             #  ]
              [
                   "1233",
                   qr#^(1)((??{ push @ctl_n, $f->($^N); push @plus, $f->($+); $^N + 1}))+(??{$^N})$#,
@@ -4336,6 +4346,21 @@ sub run_tests {
             iseq($str, "\$1 = undef, \$2 = undef, \$3 = undef, \$4 = undef, \$5 = undef, \$^R = undef");
        }
     }
+
+    {
+       local $BugId = 65372;   # minimal CURLYM limited to 32767 matches
+       my @pat = (
+           qr{a(x|y)*b},       # CURLYM
+           qr{a(x|y)*?b},      # .. with minmod
+           qr{a([wx]|[yz])*b}, # .. and without tries
+           qr{a([wx]|[yz])*?b},
+       );
+       my $len = 32768;
+       my $s = join '', 'a', 'x' x $len, 'b';
+       for my $pat (@pat) {
+           ok($s =~ $pat, $pat);
+       }
+    }
     #
     # This should be the last test.
     #