mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
APPEND tests
This commit is contained in:
parent
4b00bebd3d
commit
3c290b9b52
@ -20,7 +20,7 @@ array set ::redis::multibulkarg {}
|
||||
|
||||
# Flag commands requiring last argument as a bulk write operation
|
||||
foreach redis_bulk_cmd {
|
||||
set setnx rpush lpush lset lrem sadd srem sismember echo getset smove zadd zrem zscore zincrby
|
||||
set setnx rpush lpush lset lrem sadd srem sismember echo getset smove zadd zrem zscore zincrby append
|
||||
} {
|
||||
set ::redis::bulkarg($redis_bulk_cmd) {}
|
||||
}
|
||||
|
@ -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 {}
|
||||
|
Loading…
Reference in New Issue
Block a user