Documentation
¶
Overview ¶
Package eventstoretest checks that an audit.EventStore keeps the contract the event trail builds on: contiguous, append-only positions per run, an idempotent re-append of the same leaf, a refusal (audit.ErrSeqTaken) of a different leaf at a stored position, and exactly one winner among writers racing for one position. Every EventStore in this repository runs it, and a new backend should too:
func TestEventStore(t *testing.T) {
db := openTestDatabase(t)
eventstoretest.Run(t, func(t *testing.T) audit.EventStore { return myEventStoreOn(db) })
}
open may be called several times in one test; every handle it returns must reach the same data (a new connection to the same database, or the same in-memory store), since the suite checks what one handle's writes look like through another and races appends across handles. Run IDs are unique per call, so the suite can run repeatedly against a persistent backend.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.