lsort [$r smembers setres]
} [lsort -uniq "[$r smembers set1] [$r smembers set2]"]
- test {SUNIONSTORE with same src and dest} {
- $r sunionstore set1 set1 set1
- $r scard set1
- } {1000}
-
test {SINTER against three sets} {
$r sadd set3 999
$r sadd set3 995
lsort [$r smembers setres]
} {995 999}
- test {SINTERSTORE with same src and dest} {
- $r sinterstore set1 set1 set1
- $r scard set1
- } {1000}
-
test {SUNION with non existing keys} {
lsort [$r sunion nokey1 set1 set2 nokey2]
} [lsort -uniq "[$r smembers set1] [$r smembers set2]"]
lsort [$r smembers sres]
} {1 2 3 4}
+ test {SPOP basics} {
+ $r del myset
+ $r sadd myset 1
+ $r sadd myset 2
+ $r sadd myset 3
+ list [lsort [list [$r spop myset] [$r spop myset] [$r spop myset]]] [$r scard myset]
+ } {{1 2 3} 0}
+
test {SAVE - make sure there are all the types as values} {
$r lpush mysavelist hello
$r lpush mysavelist world