This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Regression tests for 4 cases reported by Philip Hazel++.
authorJames E Keenan <jkeenan@cpan.org>
Tue, 30 Jul 2013 01:31:28 +0000 (21:31 -0400)
committerJames E Keenan <jkeenan@cpan.org>
Fri, 2 Aug 2013 01:47:00 +0000 (21:47 -0400)
With revisions per suggestion by demerphq++.
For: RT #119069, 119071, 119073, 119075

t/re/pat_advanced.t
t/re/re_tests

index 52005ef..16edf6e 100644 (file)
@@ -1,6 +1,6 @@
 #!./perl
 #
-# This is a home for regular expression tests that don't fit into
+# This is a home for regular expression tests that do not fit into
 # the format supported by re/regexp.t.  If you want to add a test
 # that does fit that format, add it to re/re_tests, not here.
 
@@ -2225,6 +2225,15 @@ EOP
                       "get [:lower:] swash in first eval; test under /i in second");
     }
 
+    {
+        #' RT #119075
+        local $@;
+        eval { /a{0}?/; };
+        ok(! $@,
+            "PCRE regression test: No 'Quantifier follows nothing in regex' warning");
+
+    }
+
     #
     # Keep the following tests last -- they may crash perl
     #
index e992845..55a2b95 100644 (file)
@@ -1776,3 +1776,9 @@ A+(*PRUNE)BC(?{}) AAABC   y       $&      AAABC
 /[(?#](??{'b'})/       a#b     y       $&      #b
 /(?#)(?{})b/x  a#b     y       $&      b
 /(?#)(??{'b'})/x       a#b     y       $&      b
+# RT #119069: PCRE regression test: no segfault
+^(?=(a)){0}b(?1)       back    y       $&      ba
+# RT #119071: PCRE regression test: No warning of infinite regression
+(?:(a(*SKIP)b)){0}(?:(?1)|ac)  x       n       -       -
+# RT #119073: PCRE regression test: {0} => NOTHING optimization
+(?1)(?:(b)){0} b       y       $&      b