From 19d67047f70c0c332fb1de288879ab8bda1551e6 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sun, 6 Jun 2021 08:00:00 +0000 Subject: [PATCH] regex-tests: test for regressions fixed by the previous commit * 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test-regex.c b/tests/test-regex.c index 3de6213ff8..7ea73cfb6f 100644 --- a/tests/test-regex.c +++ b/tests/test-regex.c @@ -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 -- 2.39.5