summaryrefslogtreecommitdiff
path: root/test-redis.tcl
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2010-03-13 23:27:22 +0100
committerPieter Noordhuis <pcnoordhuis@gmail.com>2010-03-16 20:34:45 +0100
commitd2764cd6926fb4368ccf55f381aad7386afd5154 (patch)
tree9960e2f28c0d88d4b482885982b061ba95088384 /test-redis.tcl
parent164ee595644b711b2fbd2248898667d8ce287c58 (diff)
downloadredis-d2764cd6926fb4368ccf55f381aad7386afd5154.tar.gz
added explicit AGGREGATE [SUM|MIN|MAX] option to ZUNION/ZINTER
Diffstat (limited to 'test-redis.tcl')
-rw-r--r--test-redis.tcl16
1 files changed, 16 insertions, 0 deletions
diff --git a/test-redis.tcl b/test-redis.tcl
index 66aa0b30a..1b1f82e90 100644
--- a/test-redis.tcl
+++ b/test-redis.tcl
@@ -1491,6 +1491,14 @@ proc main {server port} {
list [$r zunion zsetc 2 zseta zsetb weights 2 3] [$r zrange zsetc 0 -1 withscores]
} {4 {a 2 b 7 d 9 c 12}}
+ test {ZUNION with AGGREGATE MIN} {
+ list [$r zunion zsetc 2 zseta zsetb aggregate min] [$r zrange zsetc 0 -1 withscores]
+ } {4 {a 1 b 1 c 2 d 3}}
+
+ test {ZUNION with AGGREGATE MAX} {
+ list [$r zunion zsetc 2 zseta zsetb aggregate max] [$r zrange zsetc 0 -1 withscores]
+ } {4 {a 1 b 2 c 3 d 3}}
+
test {ZINTER basics} {
list [$r zinter zsetc 2 zseta zsetb] [$r zrange zsetc 0 -1 withscores]
} {2 {b 3 c 5}}
@@ -1499,6 +1507,14 @@ proc main {server port} {
list [$r zinter zsetc 2 zseta zsetb weights 2 3] [$r zrange zsetc 0 -1 withscores]
} {2 {b 7 c 12}}
+ test {ZINTER with AGGREGATE MIN} {
+ list [$r zinter zsetc 2 zseta zsetb aggregate min] [$r zrange zsetc 0 -1 withscores]
+ } {2 {b 1 c 2}}
+
+ test {ZINTER with AGGREGATE MAX} {
+ list [$r zinter zsetc 2 zseta zsetb aggregate max] [$r zrange zsetc 0 -1 withscores]
+ } {2 {b 2 c 3}}
+
test {SORT against sorted sets} {
$r del zset
$r zadd zset 1 a