From 5bb06900cca8d5049017a69ddecd661c5102de94 Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Tue, 28 Jan 2025 22:42:44 -0500 Subject: [PATCH] Added more tests --- re_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/re_test.go b/re_test.go index 5ee0adb..eeb038b 100644 --- a/re_test.go +++ b/re_test.go @@ -460,6 +460,11 @@ var reTests = []struct { {`\x00ff`, nil, "\u00ff", []Group{}}, {`\x{0000ff}`, nil, "\u00ff", []Group{{0, 1}}}, {`\x{0000FF}`, nil, "\u00ff", []Group{{0, 1}}}, + {"\t\n\v\r\f\a", nil, "\t\n\v\r\f\a", []Group{{0, 6}}}, + {`\t\n\v\r\f\a`, nil, "\t\n\v\r\f\a", []Group{{0, 6}}}, + {`[\t][\n][\v][\r][\f][\b]`, nil, "\t\n\v\r\f\b", []Group{{0, 6}}}, + {`.*d`, nil, "abc\nabd", []Group{{4, 7}}}, + {`(`, nil, "-", nil}, // Todo - add numeric range tests } @@ -606,6 +611,7 @@ var groupTests = []struct { {`([\s]*)([\S]*)([\s]*)`, nil, ` testing!1972`, []Match{[]Group{{0, 13}, {0, 1}, {1, 13}, {13, 13}}, []Group{{13, 13}, {13, 13}, {13, 13}, {13, 13}}}}, {`(\s*)(\S*)(\s*)`, nil, ` testing!1972`, []Match{[]Group{{0, 13}, {0, 1}, {1, 13}, {13, 13}}, []Group{{13, 13}, {13, 13}, {13, 13}, {13, 13}}}}, + {`(([a-z]+):)?([a-z]+)$`, nil, `smil`, []Match{[]Group{{0, 4}, {-1, -1}, {-1, -1}, {0, 4}}}}, } func TestFindAllMatches(t *testing.T) {