From 7276646263e4ef39bf20ee0ee04fec5f1295eaf5 Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 15 Jan 2010 09:37:26 -0500 Subject: [PATCH] new test added --- test-redis.tcl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test-redis.tcl b/test-redis.tcl index 7d529966c..2d4b9dcbc 100644 --- a/test-redis.tcl +++ b/test-redis.tcl @@ -280,6 +280,27 @@ proc main {server port} { $r get foo } [string repeat "abcd" 1000000] + test {Very big payload random access} { + set err {} + array set payload {} + for {set j 0} {$j < 100} {incr j} { + set size [expr 1+[randomInt 100000]] + set buf [string repeat "abcd" $size] + set payload($j) $buf + $r set bigpayload_$j $buf + } + for {set j 0} {$j < 1000} {incr j} { + set index [randomInt 100] + set buf [$r get bigpayload_$index] + if {$buf != $payload($index)} { + set err "Values differ: I set '$buf' but I read back '$buf2'" + break + } + } + unset payload + set _ $err + } {} + test {SET 10000 numeric keys and access all them in reverse order} { set err {} for {set x 0} {$x < 10000} {incr x} {