SRANDMEMBER test

This commit is contained in:
antirez
2009-11-21 13:56:17 +01:00
parent ed5a857a6d
commit 6cbfd2b3d9
2 changed files with 14 additions and 1 deletions

View File

@ -619,6 +619,19 @@ proc main {server port} {
$r zadd mytestzset c 30
$r save
} {OK}
test {SRANDMEMBER} {
$r del myset
$r sadd myset a
$r sadd myset b
$r sadd myset c
unset -nocomplain myset
array set myset {}
for {set i 0} {$i < 100} {incr i} {
set myset([$r srandmember myset]) 1
}
lsort [array names myset]
} {a b c}
test {Create a random list} {
set tosort {}