mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
Test TOUCH and new TTL / TYPE behavior about object access time.
This commit is contained in:
parent
226f679651
commit
3bd20ea2f1
@ -46,6 +46,7 @@ set ::all_tests {
|
|||||||
unit/scripting
|
unit/scripting
|
||||||
unit/maxmemory
|
unit/maxmemory
|
||||||
unit/introspection
|
unit/introspection
|
||||||
|
unit/introspection-2
|
||||||
unit/limits
|
unit/limits
|
||||||
unit/obuf-limits
|
unit/obuf-limits
|
||||||
unit/bitops
|
unit/bitops
|
||||||
|
23
tests/unit/introspection-2.tcl
Normal file
23
tests/unit/introspection-2.tcl
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
start_server {tags {"introspection"}} {
|
||||||
|
test {TTL and TYPYE do not alter the last access time of a key} {
|
||||||
|
r set foo bar
|
||||||
|
after 3000
|
||||||
|
r ttl foo
|
||||||
|
r type foo
|
||||||
|
assert {[r object idletime foo] >= 2}
|
||||||
|
}
|
||||||
|
|
||||||
|
test {TOUCH alters the last access time of a key} {
|
||||||
|
r set foo bar
|
||||||
|
after 3000
|
||||||
|
r touch foo
|
||||||
|
assert {[r object idletime foo] < 2}
|
||||||
|
}
|
||||||
|
|
||||||
|
test {TOUCH returns the number of existing keys specified} {
|
||||||
|
r flushdb
|
||||||
|
r set key1 1
|
||||||
|
r set key2 2
|
||||||
|
r touch key0 key1 key2 key3
|
||||||
|
} 2
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user