Documentation
¶
Overview ¶
Package ledgertest runs the shared store fixtures in lib/ledger/testdata/store/v1 against a store.Store implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dir ¶
Dir returns the fixture directory: $EXT_LEDGER_TESTDATA/store/v1, or testdata/store/v1 found by walking up from the working directory.
func Match ¶
Match reports whether actual, a decoded JSON value, satisfies want, the expectation of a case. An object matches when each field it names matches, and a field absent from actual counts as null. A string in place of an object matches the object's "id". Two RFC 3339 strings match when they name the same instant. Null, false, 0, "" and [] match an absent value.
func RunBehaviour ¶
RunBehaviour checks what the fixtures cannot hold: live watch delivery, a watch that overflows its buffer, concurrent writers, and a closed store.
func RunFingerprints ¶
func RunFingerprints(t *testing.T, canonicalize func(store.Transaction) (json.RawMessage, string, error))
RunFingerprints checks a binding against the canonical transaction fixtures.
Types ¶
type Backend ¶
type Backend struct {
// Open opens a store in dir with the options. Opening the same dir again
// reopens the same store; a store that is not durable ignores dir.
Open func(t testing.TB, dir string, options store.Options) store.Store
// Durable stores also run the cases that reopen the store.
Durable bool
}
Backend opens the store under test.