Commit a6e312bf authored by antirez's avatar antirez
Browse files

Added two new tests for RENAME, currently both will fail because of bug #128.

parent 0e841b99
...@@ -262,6 +262,25 @@ start_server {tags {"basic"}} { ...@@ -262,6 +262,25 @@ start_server {tags {"basic"}} {
format $err format $err
} {ERR*} } {ERR*}
test {RENAME with volatile key, should move the TTL as well} {
r del mykey mykey2
r set mykey foo
r expire mykey 100
assert {[r ttl mykey] > 95 && [r ttl mykey] <= 100}
r rename mykey mykey2
assert {[r ttl mykey2] > 95 && [r ttl mykey2] <= 100}
}
test {RENAME with volatile key, should not inherit TTL of target key} {
r del mykey mykey2
r set mykey foo
r set mykey2 bar
r expire mykey2 100
assert {[r ttl mykey] == -1 && [r ttl mykey2] > 0}
r rename mykey mykey2
r ttl mykey2
} {-1}
test {DEL all keys again (DB 0)} { test {DEL all keys again (DB 0)} {
foreach key [r keys *] { foreach key [r keys *] {
r del $key r del $key
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment