mirror of
https://github.com/hay-kot/homebox.git
synced 2025-08-04 08:40:28 +00:00
sort slice before testing
This commit is contained in:
parent
7cf76294a4
commit
1b66a051fc
1 changed files with 6 additions and 1 deletions
|
@ -2,6 +2,7 @@ package set
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -247,7 +248,11 @@ func TestSet_Slice(t *testing.T) {
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
if got := tt.s.Slice(); !reflect.DeepEqual(got, tt.want) {
|
got := tt.s.Slice()
|
||||||
|
|
||||||
|
sort.Strings(got)
|
||||||
|
|
||||||
|
if !reflect.DeepEqual(got, tt.want) {
|
||||||
t.Errorf("Set.Slice() = %v, want %v", got, tt.want)
|
t.Errorf("Set.Slice() = %v, want %v", got, tt.want)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue