]> Savannah Git Hosting - gnulib.git/commitdiff
regex-tests: test for regressions fixed by the previous commit
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 6 Jun 2021 08:00:00 +0000 (08:00 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 6 Jun 2021 08:00:00 +0000 (08:00 +0000)
* tests/test-regex.c (tests): Add test cases for *+ and ** regressions
fixed by the previous commit.

Link: https://lists.gnu.org/archive/html/bug-gnulib/2021-04/msg00134.html
tests/test-regex.c

index 3de6213ff8eac21c48b5079995a9902b8498b706..7ea73cfb6fdebd066acb8d00c079bef6d61071b7 100644 (file)
@@ -116,6 +116,10 @@ static struct
     "level", REG_NOSUB | REG_EXTENDED, 0, { { -1, -1 } } },
   { "^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?).?\\9\\8\\7\\6\\5\\4\\3\\2\\1$",
     "ababababa", REG_EXTENDED, 1, { { 0, 9 } } },
+  /* Test for *+ match.  */
+  { "^a*+(.)", "ab", REG_EXTENDED, 2, { { 0, 2 }, { 1, 2 } } },
+  /* Test for ** match.  */
+  { "^(a*)*(.)", "ab", REG_EXTENDED, 3, { { 0, 2 }, { 0, 1 }, { 1, 2 } } },
 };
 
 static void