test

package
v0.19.19 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enum added in v0.16.2

func Enum[E enum.Enum](t *testing.T, spec EnumSpec[E])

Enum is a helper for testing enumeration types.

func Expect

func Expect(
	t *testing.T,
	failMessage string,
	got, want any,
	options ...cmp.Option,
)

Expect compares two values and fails the test if they are different.

func ExpectPanic added in v0.16.2

func ExpectPanic(
	t *testing.T,
	want string,
	fn func(),
)

ExpectPanic asserts that a function panics with a specific value.

Types

type EnumSpec added in v0.16.2

type EnumSpec[E enum.Enum] struct {
	Range       func() iter.Seq[E]
	Switch      any // func(E, ...func())
	MapToString any // func(E, ...func() string)
}

EnumSpec is a set of parameters for testing enumeration types.

Jump to

Keyboard shortcuts

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