Documentation
¶
Overview ¶
Package storetest provides backend-conformance suites for the four storage primitives — Ledger, Leaser, KV, and Blobs. A backend's own _test.go calls TestLedger/TestLeaser/TestKV/TestBlobs with a factory that returns a fresh, empty primitive; the suite drives every contract behavior shared by all backends and classifies failures with errors.As against the storage-canonical typed errors — never by string.
The suites live in regular (non-_test.go) files and take an extra newBackend parameter, so `go test` never auto-runs them and `go vet`'s test-signature check (which inspects only _test.go files) never flags them — the same pattern the standard library uses for testing/fstest.TestFS. Importing "testing" from a regular file is idiomatic for this conformance-suite shape.
Backend-specific behavior — copy-in/copy-out ownership, cursor internals, cross-process lease reclaim, ctx-honoring — is deliberately out of scope and stays in each backend's own tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestBlobs ¶
TestBlobs runs the Blobs conformance suite. newBackend must return a fresh, empty Blobs; register any cleanup via t.Cleanup inside newBackend.
func TestKV ¶
TestKV runs the KV conformance suite. newBackend must return a fresh, empty KV; register any cleanup via t.Cleanup inside newBackend.
func TestLeaser ¶
TestLeaser runs the Leaser conformance suite. newBackend must return a fresh, empty Leaser; register any cleanup via t.Cleanup inside newBackend.
Cross-process reclaim (a dead holder's lease being reclaimed by the backend's native mechanism) is "where testable" and left to each backend's own tests.
Types ¶
This section is empty.