Test coverage for new module APIs: dbsize, flushall, randomkey, lru get/set

This commit is contained in:
Oran Agra
2019-11-04 19:30:31 +02:00
parent 720d1fd3bb
commit 3adf10b809
2 changed files with 88 additions and 0 deletions

View File

@ -16,4 +16,23 @@ start_server {tags {"modules"}} {
assert { [string match "*cmdstat_module*" $info] }
}
test {test module db commands} {
r set x foo
set key [r test.randomkey]
assert_equal $key "x"
assert_equal [r test.dbsize] 1
r test.flushall
assert_equal [r test.dbsize] 0
}
test {test modle lru api} {
r set x foo
set lru [r test.getlru x]
assert { $lru <= 1 }
r test.setlru x 100
set idle [r object idletime x]
assert { $idle >= 100 }
set lru [r test.getlru x]
assert { $lru >= 100 }
}
}