Skip to content

Commit

Permalink
Slight rework to slice test to make it consistently pass
Browse files Browse the repository at this point in the history
  • Loading branch information
DaltonSW committed Aug 15, 2024
1 parent c2d12f6 commit f618b37
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions aocutils/strings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package aocutils

import (
"reflect"
"slices"
"testing"
)

Expand Down Expand Up @@ -75,6 +76,8 @@ func TestFindSubstringsOfLength(t *testing.T) {

for _, test := range tests {
result := FindSubstringsOfLength(test.input, test.length)
slices.Sort(result)
slices.Sort(test.expected)
if !reflect.DeepEqual(result, test.expected) {
t.Errorf("FindSubstringsOfLength(%q, %d) = %v; expected %v", test.input, test.length, result, test.expected)
}
Expand Down

0 comments on commit f618b37

Please sign in to comment.