diff options
author | antirez <antirez@gmail.com> | 2010-02-04 16:38:33 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2010-02-04 16:38:33 +0100 |
commit | 3c290b9b52c0db299c630cc508d2620ab3497759 (patch) | |
tree | ac9a430290a5990265a703cc3800820e101a13d7 /test-redis.tcl | |
parent | 4b00bebd3db6642ce0662888ff856de1fa593734 (diff) | |
download | redis-3c290b9b52c0db299c630cc508d2620ab3497759.tar.gz |
APPEND tests
Diffstat (limited to 'test-redis.tcl')
-rw-r--r-- | test-redis.tcl | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test-redis.tcl b/test-redis.tcl index c0a025af2..14a1256e0 100644 --- a/test-redis.tcl +++ b/test-redis.tcl @@ -1600,6 +1600,29 @@ proc main {server port} { list $v1 $v2 $v3 } {QUEUED QUEUED {{a b c} PONG}} + test {APPEND basics} { + list [$r append foo bar] [$r get foo] \ + [$r append foo 100] [$r get foo] + } {3 bar 6 bar100} + + test {APPEND fuzzing} { + set err {} + foreach type {binary alpha compr} { + set buf {} + $r del x + for {set i 0} {$i < 1000} {incr i} { + set bin [randstring 0 10 $type] + append buf $bin + $r append x $bin + } + if {$buf != [$r get x]} { + set err "Expected '$buf' found '[$r get x]'" + break + } + } + set _ $err + } {} + # Leave the user with a clean DB before to exit test {FLUSHDB} { set aux {} |