Skip to content

Commit

Permalink
fix #143 FILTER should not have white space from the EXCLUDE ( (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkorland authored Apr 5, 2022
1 parent 7a5af81 commit 23c6554
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion redisearch/query.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package redisearch

import (
"fmt"
"math"

"github.com/gomodule/redigo/redis"
Expand Down Expand Up @@ -238,7 +239,7 @@ func appendNumArgs(num float64, exclude bool, args redis.Args) redis.Args {
}

if exclude {
return append(args, "(", num)
return append(args, fmt.Sprint("(", num))
}
return append(args, num)
}
Expand Down
2 changes: 1 addition & 1 deletion redisearch/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func Test_appendNumArgs(t *testing.T) {
want redis.Args
}{
{"1 arg", args{1.0, false, redis.Args{}}, redis.Args{1.0}},
{"1 excluded arg", args{1.0, true, redis.Args{}}, redis.Args{"(", 1.0}},
{"2.54 excluded arg", args{2.54, true, redis.Args{}}, redis.Args{"(2.54"}},
{"+inf", args{math.Inf(1), false, redis.Args{}}, redis.Args{"+inf"}},
{"+inf", args{math.Inf(-1), false, redis.Args{}}, redis.Args{"-inf"}},
}
Expand Down

0 comments on commit 23c6554

Please sign in to comment.