From e45272884e61f266662bcf0e8f3799c986236de6 Mon Sep 17 00:00:00 2001 From: Wen Hui Date: Tue, 16 May 2023 12:26:49 -0400 Subject: Adding missing test case for smembers scard commands (#12148) Minor missing test case addition. SMEMBERS SCARD against non set SMEMBERS SCARD against non existing key --- tests/unit/type/set.tcl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/unit/type/set.tcl b/tests/unit/type/set.tcl index 4885c365e..2d005c675 100644 --- a/tests/unit/type/set.tcl +++ b/tests/unit/type/set.tcl @@ -53,14 +53,18 @@ start_server { assert_equal {16 17} [lsort [r smembers myset]] } - test {SMISMEMBER against non set} { + test {SMISMEMBER SMEMBERS SCARD against non set} { r lpush mylist foo assert_error WRONGTYPE* {r smismember mylist bar} + assert_error WRONGTYPE* {r smembers mylist} + assert_error WRONGTYPE* {r scard mylist} } - test {SMISMEMBER non existing key} { + test {SMISMEMBER SMEMBERS SCARD against non existing key} { assert_equal {0} [r smismember myset1 foo] assert_equal {0 0} [r smismember myset1 foo bar] + assert_equal {} [r smembers myset1] + assert_equal {0} [r scard myset1] } test {SMISMEMBER requires one or more members} { -- cgit v1.2.1