summaryrefslogtreecommitdiff
path: root/tests/unit/introspection-2.tcl
blob: 350a8a0169a4dbfaef89a4589fbbb8572b16749c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
}