kape-testkit
Reusable contract checks for Kape backend adapters.
The helpers exercise the public CacheBackend seam: scalar and batch
miss/hit behavior, i64 millisecond TTL boundaries, expiry, duplicate read
positions, duplicate batch-write rejection, removal, and clear. Built-in
adapters use the same suite while keeping service-backed Redis and PostgreSQL
runs explicit. get_random_string supplies unique keys for examples and tests.
[]
= "0.1.0"
= { = "1", = ["macros", "rt-multi-thread", "time"] }
use CacheBackend;
use ;
async
assert_expiring_contract uses tokio::time::sleep, so expiration checks must
run inside a Tokio runtime, such as a #[tokio::test]. The remaining helpers do
not perform timed waits.