Help us shape the future of Go! Take the 2026 Go Developer Survey

storetest

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

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

func TestBlobs(t *testing.T, newBackend func(t *testing.T) storage.Blobs)

TestBlobs runs the Blobs conformance suite. newBackend must return a fresh, empty Blobs; register any cleanup via t.Cleanup inside newBackend.

func TestKV

func TestKV(t *testing.T, newBackend func(t *testing.T) storage.KV)

TestKV runs the KV conformance suite. newBackend must return a fresh, empty KV; register any cleanup via t.Cleanup inside newBackend.

func TestLeaser

func TestLeaser(t *testing.T, newBackend func(t *testing.T) storage.Leaser)

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.

func TestLedger

func TestLedger(t *testing.T, newBackend func(t *testing.T) storage.Ledger)

TestLedger runs the Ledger conformance suite. newBackend must return a fresh, empty Ledger; register any cleanup via t.Cleanup inside newBackend.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL