X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/43c9dc7bd273f39522119415318ec750e678748a..6bea3d5f58a5aae62ce2083309a9ab88e1e673d8:/test-redis.tcl diff --git a/test-redis.tcl b/test-redis.tcl index 9c28ad64..bcc5ee3d 100644 --- a/test-redis.tcl +++ b/test-redis.tcl @@ -22,6 +22,14 @@ proc main {server port} { set r [redis $server $port] set err "" + # The following AUTH test should be enabled only when requirepass + # is set in redis.conf and redis-server was started with + # redis.conf as the first argument. + + #test {AUTH with requirepass in redis.conf} { + # $r auth foobared + #} {OK} + test {DEL all keys to start with a clean DB} { foreach key [$r keys *] {$r del $key} $r dbsize @@ -580,6 +588,29 @@ proc main {server port} { $r mget foo baazz bar myset } {BAR {} FOO {}} + test {RANDOMKEY} { + $r flushall + $r set foo x + $r set bar y + set foo_seen 0 + set bar_seen 0 + for {set i 0} {$i < 100} {incr i} { + set rkey [$r randomkey] + if {$rkey eq {foo}} { + set foo_seen 1 + } + if {$rkey eq {bar}} { + set bar_seen 1 + } + } + list $foo_seen $bar_seen + } {1 1} + + test {RANDOMKEY against empty DB} { + $r flushall + $r randomkey + } {} + # Leave the user with a clean DB before to exit test {FLUSHALL} { $r flushall