recordstest

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package recordstest is the contract every record store of gonsole/auth keeps, run as one test suite.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, build func(t *testing.T) Fixture)

Run checks every rule of the contract as a parallel subtest, each on a fresh fixture that build returns.

Types

type Fixture

type Fixture struct {
	// Records is the store under test, not yet migrated.
	Records auth.RecordStore
	// Migrate creates what the store keeps its records in.
	Migrate func(ctx context.Context) error
	// Account creates an account at the address email and returns its id.
	Account func(ctx context.Context, email string) (string, error)
	// Plant stores entry as Insert would, but as applied at appliedAt.
	Plant func(ctx context.Context, entry auth.Entry, appliedAt time.Time) error
}

Fixture is one fresh record store and the hooks the suite drives it with.

Jump to

Keyboard shortcuts

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