fixture

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fixture

type Fixture struct {
	testing.TB
}

func (*Fixture) SetTB

func (f *Fixture) SetTB(tb testing.TB)

type FixtureInit

type FixtureInit interface {
	SetTB(testing.TB)
}

type FixtureSetup

type FixtureSetup[T FixtureInit] struct {
	TB      testing.TB
	Fixture T
	Include func(val reflect.Value) bool
	Deps    []any
	// contains filtered or unexported fields
}

func (*FixtureSetup[T]) Setup

func (f *FixtureSetup[T]) Setup() Setuper

type NullSetup

type NullSetup struct{}

NullSetuper is just a Setuper that ignores setup calls on the null instance

func (*NullSetup) Setup

func (s *NullSetup) Setup()

type Setuper

type Setuper interface{ Setup() }

func InitFixture

func InitFixture[T FixtureInit](
	t testing.TB,
	fixture T,
	deps ...any,
) (T, Setuper)

Jump to

Keyboard shortcuts

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