X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/271f08784264e25c3dbcd751f8c9ee1b1ad8306e..cd4aba36cdf5b9599e94029793dcfd13cd199577:/tests/unit/type/set.tcl diff --git a/tests/unit/type/set.tcl b/tests/unit/type/set.tcl index ef7d668c..bdd1f9bf 100644 --- a/tests/unit/type/set.tcl +++ b/tests/unit/type/set.tcl @@ -97,6 +97,20 @@ start_server { assert_equal {3 5} [lsort [r smembers myset]] } + test {SREM with multiple arguments} { + r del myset + r sadd myset a b c d + assert_equal 0 [r srem myset k k k] + assert_equal 2 [r srem myset b d x y] + lsort [r smembers myset] + } {a c} + + test {SREM variadic version with more args needed to destroy the key} { + r del myset + r sadd myset 1 2 3 + r srem myset 1 2 3 4 5 6 7 8 + } {3} + foreach {type} {hashtable intset} { for {set i 1} {$i <= 5} {incr i} { r del [format "set%d" $i]