Skip to content

Commit

Permalink
fix(test): sort results in example test (#3292)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndyakov authored Mar 4, 2025
1 parent cd55713 commit 8e4a2ee
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions doctests/query_range_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,12 @@ func ExampleClient_query_range() {
FieldName: "price",
},
},
SortBy: []redis.FTSearchSortBy{
{
FieldName: "price",
Asc: true,
},
},
},
).Result()

Expand Down Expand Up @@ -263,6 +269,12 @@ func ExampleClient_query_range() {
FieldName: "price",
},
},
SortBy: []redis.FTSearchSortBy{
{
FieldName: "price",
Asc: true,
},
},
},
).Result()

Expand All @@ -289,6 +301,12 @@ func ExampleClient_query_range() {
FieldName: "price",
},
},
SortBy: []redis.FTSearchSortBy{
{
FieldName: "price",
Asc: true,
},
},
Filters: []redis.FTSearchFilter{
{
FieldName: "price",
Expand Down Expand Up @@ -354,19 +372,19 @@ func ExampleClient_query_range() {

// Output:
// 3
// bicycle:2 : price 815
// bicycle:5 : price 810
// bicycle:2 : price 815
// bicycle:9 : price 815
// 3
// bicycle:2 : price 815
// bicycle:5 : price 810
// bicycle:2 : price 815
// bicycle:9 : price 815
// 5
// bicycle:1 : price 1200
// bicycle:4 : price 3200
// bicycle:8 : price 1200
// bicycle:6 : price 2300
// bicycle:4 : price 3200
// bicycle:3 : price 3400
// bicycle:8 : price 1200
// 7
// bicycle:0 : price 270
// bicycle:7 : price 430
Expand Down

0 comments on commit 8e4a2ee

Please sign in to comment.