mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
GETSET tests
This commit is contained in:
parent
a431eb74ba
commit
7ac6d4613f
@ -19,7 +19,7 @@ array set ::redis::bulkarg {}
|
|||||||
|
|
||||||
# Flag commands requiring last argument as a bulk write operation
|
# Flag commands requiring last argument as a bulk write operation
|
||||||
foreach redis_bulk_cmd {
|
foreach redis_bulk_cmd {
|
||||||
set setnx rpush lpush lset lrem sadd srem sismember echo
|
set setnx rpush lpush lset lrem sadd srem sismember echo getset
|
||||||
} {
|
} {
|
||||||
set ::redis::bulkarg($redis_bulk_cmd) {}
|
set ::redis::bulkarg($redis_bulk_cmd) {}
|
||||||
}
|
}
|
||||||
|
@ -646,6 +646,15 @@ proc main {server port} {
|
|||||||
$r randomkey
|
$r randomkey
|
||||||
} {}
|
} {}
|
||||||
|
|
||||||
|
test {GETSET (set new value)} {
|
||||||
|
list [$r getset foo xyz] [$r get foo]
|
||||||
|
} {{} xyz}
|
||||||
|
|
||||||
|
test {GETSET (replace old value)} {
|
||||||
|
$r set foo bar
|
||||||
|
list [$r getset foo xyz] [$r get foo]
|
||||||
|
} {bar xyz}
|
||||||
|
|
||||||
# Leave the user with a clean DB before to exit
|
# Leave the user with a clean DB before to exit
|
||||||
test {FLUSHALL} {
|
test {FLUSHALL} {
|
||||||
$r flushall
|
$r flushall
|
||||||
|
Loading…
x
Reference in New Issue
Block a user