Added unicode support

Replaced strings with rune-slices, which capture unicode codepoints more
accurately.
This commit is contained in:
2024-11-18 10:41:50 -05:00
parent 805766a5ba
commit 8a1f1dc621
5 changed files with 8 additions and 8 deletions

View File

@@ -116,7 +116,7 @@ func TestFindAllMatches(t *testing.T) {
t.Run(test.re+" "+test.str, func(t *testing.T) {
re_postfix := shuntingYard(test.re)
startState := thompson(re_postfix)
matchIndices := findAllMatches(startState, test.str)
matchIndices := findAllMatches(startState, []rune(test.str))
if !slices.Equal(test.result, matchIndices) {
t.Errorf("Wanted %v Got %v\n", test.result, matchIndices)
}