diff options
author | antirez <antirez@gmail.com> | 2011-10-10 12:01:13 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2011-10-10 15:25:22 +0200 |
commit | a6e312bf9a410f6342914510a58da4461a3beff2 (patch) | |
tree | 936b71c17578bb62449f42b6297c648140596294 | |
parent | 0e841b998a4a7187585a965f96202cc7bacf5163 (diff) | |
download | redis-a6e312bf9a410f6342914510a58da4461a3beff2.tar.gz |
Added two new tests for RENAME, currently both will fail because of bug #128.
-rw-r--r-- | tests/unit/basic.tcl | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/unit/basic.tcl b/tests/unit/basic.tcl index a7267fd8f..86645e95f 100644 --- a/tests/unit/basic.tcl +++ b/tests/unit/basic.tcl @@ -262,6 +262,25 @@ start_server {tags {"basic"}} { format $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)} { foreach key [r keys *] { r del $key |