Skip to content

Commit

Permalink
fix tests and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
alicebob committed Dec 25, 2021
1 parent 16948fd commit e8861fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -168,6 +168,7 @@ Implemented commands:
- ZREVRANGEBYSCORE
- ZREVRANK
- ZSCORE
- ZUNION
- ZUNIONSTORE
- ZSCAN
- Stream keys
Expand Down
8 changes: 4 additions & 4 deletions cmd_sorted_set_test.go
Expand Up @@ -1551,27 +1551,27 @@ func TestZunion(t *testing.T) {

t.Run("simple case", func(t *testing.T) {
mustDo(t, c,
"ZUNION", "2", "h1", "h2", proto.Strings("field2", "field1"),
"ZUNION", "2", "h1", "h2", proto.Strings("field1", "field2"),
)
})

t.Run("WITHSCORES", func(t *testing.T) {
mustDo(t, c,
"ZUNION", "2", "h1", "h2", "WITHSCORES", proto.Strings("field2", "4", "field1", "2"),
"ZUNION", "2", "h1", "h2", "WITHSCORES", proto.Strings("field1", "2", "field2", "4"),
)
})

t.Run("WEIGHTS", func(t *testing.T) {
mustDo(t, c,
"ZUNION", "2", "h1", "h2", "WeiGHtS", "4.5", "12", "WITHSCORES",
proto.Strings("field2", "33", "field1", "16.5"),
proto.Strings("field1", "16.5", "field2", "33"),
)
})

t.Run("AGGREGATE", func(t *testing.T) {
mustDo(t, c,
"ZUNION", "2", "h1", "h2", "AgGrEgAtE", "min", "WITHSCORES",
proto.Strings("field2", "2", "field1", "1"),
proto.Strings("field1", "1", "field2", "2"),
)
})

Expand Down

0 comments on commit e8861fe

Please sign in to comment.