diff options
Diffstat (limited to 'tests/unit/expire.tcl')
-rw-r--r-- | tests/unit/expire.tcl | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/unit/expire.tcl b/tests/unit/expire.tcl index de24eabed..11fb82ef0 100644 --- a/tests/unit/expire.tcl +++ b/tests/unit/expire.tcl @@ -219,4 +219,17 @@ start_server {tags {"expire"}} { set ttl [r ttl foo] assert {$ttl <= 98 && $ttl > 90} } + + test {SET command will remove expire} { + r set foo bar EX 100 + r set foo bar + r ttl foo + } {-1} + + test {SET - use KEEPTTL option, TTL should not be removed} { + r set foo bar EX 100 + r set foo bar KEEPTTL + set ttl [r ttl foo] + assert {$ttl <= 100 && $ttl > 90} + } } |