Skip to content

Commit e81a330

Browse files
DOC-5078 fixed nondeterministic test
1 parent dcc79b9 commit e81a330

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

doctests/vec_set_test.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package example_commands_test
55
import (
66
"context"
77
"fmt"
8+
"sort"
89

910
"github.com/redis/go-redis/v9"
1011
)
@@ -244,8 +245,12 @@ func ExampleClient_vectorset() {
244245
panic(err)
245246
}
246247

248+
sort.Slice(res23, func(i, j int) bool {
249+
return res23[i].Name < res23[j].Name
250+
})
251+
247252
fmt.Println(res23)
248-
// >>> [{pt:A 1} {pt:E 0.8535534143447876} {pt:D 0.5} {pt:C 0.5}]
253+
// >>> [{pt:A 1} {pt:C 0.5} {pt:D 0.5} {pt:E 0.8535534143447876}]
249254
// STEP_END
250255

251256
// STEP_START vsim_filter
@@ -365,7 +370,7 @@ func ExampleClient_vectorset() {
365370
// true
366371
// 5
367372
// [pt:E pt:A pt:D pt:C pt:B]
368-
// [{pt:A 1} {pt:E 0.8535534143447876} {pt:D 0.5} {pt:C 0.5}]
373+
// [{pt:A 1} {pt:C 0.5} {pt:D 0.5} {pt:E 0.8535534143447876}]
369374
// true
370375
// true
371376
// true

0 commit comments

Comments
 (0)