Added more tests

master
Aadhavan Srinivasan 1 month ago
parent ea64ddc88a
commit d986999001

@ -77,6 +77,7 @@ var reTests = []struct {
{"[^a]+", "qqqaq", []MatchIndex{{0, 3}, {4, 5}}},
{"[^0-9]+", "a1b2c3dd", []MatchIndex{{0, 1}, {2, 3}, {4, 5}, {6, 8}}},
{"[^abc]+", "ababababbababaccacacacaca", []MatchIndex{}},
{`\[`, "a[b[c[]]]", []MatchIndex{{1, 2}, {3, 4}, {5, 6}}},
{`\([^)]+\)`, "Not (paranthesized), (so) is (this) not", []MatchIndex{{4, 19}, {21, 25}, {29, 35}}},
{"^ab", "ab bab", []MatchIndex{{0, 2}}},
@ -113,6 +114,7 @@ var reTests = []struct {
// Unicode tests
{`.+`, "úïäö´«åæïëòöê»éãçâï«úïòíñ", []MatchIndex{{0, 25}}},
{`a.b`, "a²b", []MatchIndex{{0, 3}}},
{`[^a]+`, "úïäö´«åæïëòöê»éãçâï«úïòíñ", []MatchIndex{{0, 25}}},
}
func TestFindAllMatches(t *testing.T) {

Loading…
Cancel
Save