Documentation
¶
Overview ¶
Package drivertest provides conformance tests for cache implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunConformanceTests ¶
RunConformanceTests runs conformance tests for driver implementations of the [cache.Cache[K]] interface.
Types ¶
type Harness ¶
type Harness[K driver.String] interface { // MakeCache makes a [driver.Cache] for testing. MakeCache(context.Context) (driver.Cache[K], error) // Close closes resources used by the harness. Close() // Options returns the set of options that the cache supports. Options() Options }
Harness descibes the functionality test harnesses must provide to run conformance tests.
type HarnessMaker ¶
type HarnessMaker[K driver.String, TB testing.TB] func(ctx context.Context, t TB) (Harness[K], error)
HarnessMaker describes functions that construct a harness for running tests. It is called exactly once per test; Harness.Close() will be called when the test is complete.
type Options ¶
type Options struct { // PatternMatchingDisabled is true if the cache does not support pattern matching. // If true, the cache does not support the following methods: // - Count // - DelKeys PatternMatchingDisabled bool // CloseIsNoop is true if the Close method is a no-op for the cache. // If true, the cache should still be usable after Close is called. CloseIsNoop bool }
Options describes the set of options that a cache supports.
Click to show internal directories.
Click to hide internal directories.