X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/2c572622fb99f32328de58f815953f17d4ad0e4d..890a2ed989274cb09b5cde1def3935e110ec3cb9:/tests/unit/expire.tcl?ds=sidebyside diff --git a/tests/unit/expire.tcl b/tests/unit/expire.tcl index 5de907ab..6f16ed58 100644 --- a/tests/unit/expire.tcl +++ b/tests/unit/expire.tcl @@ -60,4 +60,15 @@ start_server {tags {"expire"}} { catch {r setex z -10 foo} e set _ $e } {*invalid expire*} + + test {PERSIST can undo an EXPIRE} { + r set x foo + r expire x 50 + list [r ttl x] [r persist x] [r ttl x] [r get x] + } {50 1 -1 foo} + + test {PERSIST returns 0 against non existing or non volatile keys} { + r set x foo + list [r persist foo] [r persist nokeyatall] + } {0 0} }