提交 7ac6d461 编写于 作者: A antirez

GETSET tests

上级 a431eb74
...@@ -19,7 +19,7 @@ array set ::redis::bulkarg {} ...@@ -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} { ...@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册