From 263619c50c50a9a329bd54aab11b19fa62930955 Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Sat, 25 Jan 2025 12:23:15 -0500 Subject: [PATCH] Added more test cases --- re_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/re_test.go b/re_test.go index 7122317..952f351 100644 --- a/re_test.go +++ b/re_test.go @@ -237,6 +237,24 @@ var reTests = []struct { {`(abc`, nil, `-`, nil}, {`a]`, nil, `a]`, []Group{{0, 2}}}, {`a[]]b`, nil, `a]b`, []Group{{0, 3}}}, + {`a[\]]b`, nil, `a]b`, []Group{{0, 3}}}, + {`a[^bc]d`, nil, `aed`, []Group{{0, 3}}}, + {`a[^bc]d`, nil, `abd`, []Group{}}, + {`a[^-b]c`, nil, `adc`, []Group{{0, 3}}}, + {`a[^-b]c`, nil, `a-c`, []Group{}}, + {`a[^]b]c`, nil, `a]c`, []Group{}}, + {`a[^]b]c`, nil, `adc`, []Group{{0, 3}}}, + {`\ba\b`, nil, `a-`, []Group{{0, 1}}}, + {`\ba\b`, nil, `-a`, []Group{{1, 2}}}, + {`\ba\b`, nil, `-a-`, []Group{{1, 2}}}, + {`\by\b`, nil, `xy`, []Group{}}, + {`\by\b`, nil, `yz`, []Group{}}, + {`\by\b`, nil, `xyz`, []Group{}}, + {`x\b`, nil, `xyz`, []Group{}}, + {`x\B`, nil, `xyz`, []Group{{0, 1}}}, + {`\Bz`, nil, `xyz`, []Group{{2, 3}}}, + {`z\B`, nil, `xyz`, []Group{}}, + {`\Bx`, nil, `xyz`, []Group{}}, // Todo - add numeric range tests }