diff --git a/TODO b/TODO index c3175783db99c866d98cbc892983dbb2b04bf3de..cf57f03f66fdc72123ddf74e7ad1d078906a5fac 100644 --- a/TODO +++ b/TODO @@ -3,7 +3,7 @@ VERSION 1.1 TODO * For now only the last argument gets integer encoded, so make sure that: 1) every multi bulk commands implemented will have the last arg that is indeed a value, and not used otherwise. 2) to explicitly call the function to encode the object in MSET and other commands where there are multiple "values". * Man pages for MSET MSETNX and SRANDMEMBER, Z-commands, ... * Use strcoll() to compare objects in sorted sets, like it already happens for SORT. -* Tests for: ZINCRBY, SRANDMEMBER, SORT with #. +* Tests for: SRANDMEMBER * Write docs for the "STORE" operaiton of SORT, and GET "#" option. * Append only mode: testing and a command to rebuild the log from scratch. diff --git a/test-redis.tcl b/test-redis.tcl index 10b1acd22acf5bceab52ee6d91c2eea46beceafd..a4c3c618a2d72f99527b24af4fb3b8f91bf36f38 100644 --- a/test-redis.tcl +++ b/test-redis.tcl @@ -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 {}