introspection-2.tcl 581 B

1234567891011121314151617181920212223
  1. start_server {tags {"introspection"}} {
  2. test {TTL and TYPYE do not alter the last access time of a key} {
  3. r set foo bar
  4. after 3000
  5. r ttl foo
  6. r type foo
  7. assert {[r object idletime foo] >= 2}
  8. }
  9. test {TOUCH alters the last access time of a key} {
  10. r set foo bar
  11. after 3000
  12. r touch foo
  13. assert {[r object idletime foo] < 2}
  14. }
  15. test {TOUCH returns the number of existing keys specified} {
  16. r flushdb
  17. r set key1 1
  18. r set key2 2
  19. r touch key0 key1 key2 key3
  20. } 2
  21. }