From 4a30977d150ad3c88a0aee58f651b986ec8e555b Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Mon, 28 Oct 2024 00:57:53 -0400 Subject: [PATCH] Added test cases --- re_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/re_test.go b/re_test.go index 72a39c8..98519f0 100644 --- a/re_test.go +++ b/re_test.go @@ -19,6 +19,8 @@ var reTests = []struct { {"(b|c|A)", "ooaoobocA", []matchIndex{{5, 6}, {7, 8}, {8, 9}}}, {"ab*", "a", []matchIndex{{0, 1}}}, {"ab*", "abb", []matchIndex{{0, 3}}}, + {"a*b", "aaab", []matchIndex{{0, 4}}}, + {"a*b", "qwqw", []matchIndex{}}, {"(abc)*", "abcabcabc", []matchIndex{{0, 9}}}, {"((abc)|(def))*", "abcdef", []matchIndex{{0, 6}}}, {"(abc)*|(def)*", "abcdef", []matchIndex{{0, 3}, {3, 3}, {3, 6}, {6, 6}}}, @@ -30,6 +32,9 @@ var reTests = []struct { {"a|b", "c", []matchIndex{}}, {"(a|b)*c", "aabbc", []matchIndex{{0, 5}}}, {"a*", "aaaaaaaa", []matchIndex{{0, 8}, {8, 8}}}, + {"ab?", "ab", []matchIndex{{0, 2}}}, + {"a?b", "ab", []matchIndex{{0, 2}}}, + {"a?", "", []matchIndex{{0, 0}}}, } func TestFindAllMatches(t *testing.T) {