Added unicode support
Replaced strings with rune-slices, which capture unicode codepoints more accurately.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user