X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/0d1650f8a9ee2df13a11685ff0eb739305b4fe1b..4264459141ee8d649dfb905a9d89adfca920728d:/tests/unit/type/set.tcl diff --git a/tests/unit/type/set.tcl b/tests/unit/type/set.tcl index bdd1f9bf..ec412b40 100644 --- a/tests/unit/type/set.tcl +++ b/tests/unit/type/set.tcl @@ -216,6 +216,23 @@ start_server { assert_error "ERR*wrong kind*" {r sunion key1 noset} } + test "SINTER should handle non existing key as empty" { + r del set1 set2 set3 + r sadd set1 a b c + r sadd set2 b c d + r sinter set1 set2 set3 + } {} + + test "SINTER with same integer elements but different encoding" { + r del set1 set2 + r sadd set1 1 2 3 + r sadd set2 1 2 3 a + r srem set2 a + assert_encoding intset set1 + assert_encoding hashtable set2 + lsort [r sinter set1 set2] + } {1 2 3} + test "SINTERSTORE against non existing keys should delete dstkey" { r set setres xxx assert_equal 0 [r sinterstore setres foo111 bar222] @@ -317,6 +334,13 @@ start_server { assert_error "ERR*wrong kind*" {r smove myset2 x foo} } + test "SMOVE with identical source and destination" { + r del set + r sadd set a b c + r smove set set b + lsort [r smembers set] + } {a b c} + tags {slow} { test {intsets implementation stress testing} { for {set j 0} {$j < 20} {incr j} {