Documentation ¶
Overview ¶
Package drivertest provides conformance tests for cache implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunConformanceTests ¶
func RunConformanceTests(t *testing.T, newHarness HarnessMaker)
RunConformanceTests runs conformance tests for driver implementations of the cache.Cache interface.
Types ¶
type Harness ¶
type Harness interface { // MakeCache makes a [cache.Cache] for testing. MakeCache(context.Context) (cache.Cache, 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 ¶
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.