conformance

package
v1.3.3 Latest Latest
Warning

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

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

Documentation

Overview

Package conformance is the shared behavioural suite every lookup backend must pass. It only uses the store interfaces, so the same cases run against the direct backend on every dialect and against the procedure backend on Postgres. Error messages are not asserted (backends word them differently), only whether an operation succeeds or fails and the values it returns.

The suite names everything it creates with Env.Prefix and never assumes empty tables, so it can run against a shared database. Env.Cleanup, when set, removes the prefixed rows.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, env Env)

Run executes the suite.

Types

type Env

type Env struct {
	Provider *lookup.Provider
	// DB and Dialect are used only to seed policy rules, which have no store method.
	DB      *sql.DB
	Dialect dialect.Dialect
	// Prefix makes every created name unique to this run.
	Prefix string
	// Cleanup removes rows whose names start with Prefix. Optional.
	Cleanup func(t *testing.T)
}

Env is one backend under test.

Jump to

Keyboard shortcuts

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