Skip to content

Commit

Permalink
Resolve final bug
Browse files Browse the repository at this point in the history
  • Loading branch information
boyter committed Mar 11, 2020
1 parent 6fa5d9b commit 66e81e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion string/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func IndexAllIgnoreCaseUnicode(haystack string, needle string, limit int) [][]in
// When we have confirmed a match we add it to our total
// but adjust the positions to the match and the length of the
// needle to ensure the byte count lines up
locs = append(locs, []int{match[0], match[0] + len(toMatch)})
locs = append(locs, []int{match[0], match[0] + len(string(toMatch))})

if limit > 0 && len(locs) > limit {
return locs[:limit]
Expand Down
2 changes: 1 addition & 1 deletion string/index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func TestIndexAllIgnoreCaseUnicodeCheckEnd(t *testing.T) {
matches := IndexAllIgnoreCaseUnicode("a ſecret a", "secret", -1)

if matches[0][0] != 2 || matches[0][1] != 9 {
t.Error("Expected 2 and 7 got", matches[0][0], "and", matches[0][1])
t.Error("Expected 2 and 9 got", matches[0][0], "and", matches[0][1])
}

if "a ſecret a"[matches[0][0]:matches[0][1]] != "ſecret" {
Expand Down

0 comments on commit 66e81e3

Please sign in to comment.