storetest

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package storetest is the conformance suite for store implementations: the in-memory store passes it today and a Postgres store must pass it later.

func TestConformance(t *testing.T) {
	storetest.Run(t, func(o store.Options) storetest.Subject { return memory.New(o) })
}

The suite passes each new store its Options: a clock.Fake (which drives CreatedAt, lock expiry and retention) and, for some tests, smaller caps and buffers. Run it under -race.

Index

Constants

This section is empty.

Variables

View Source
var Epoch = time.Date(2026, 1, 1, 0, 0, 0, 0, time.UTC)

Epoch is the fake clock's starting time.

Functions

func Run

func Run(t *testing.T, newStore NewStore)

Run runs the conformance suite against stores made by newStore.

Types

type NewStore

type NewStore func(opts store.Options) Subject

NewStore returns an empty store configured with opts.

type Subject

type Subject interface {
	store.Store
	store.Sweeper
	store.TranscriptStore
}

Subject is what an implementation provides: the Store, its retention sweeper and its transcript blobs.

Jump to

Keyboard shortcuts

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