Help us shape the future of Go! Take the 2026 Go Developer Survey

xtesting

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Expect

func Expect(
	t TestingT,
	failMessage string,
	got, want any,
	options ...cmp.Option,
)

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

func ExpectContains

func ExpectContains[T any](
	t TestingT,
	failMessage string,
	slice []T,
	want T,
	options ...cmp.Option,
)

ExpectContains asserts that slice contains an element equal to want.

func ExpectPanic

func ExpectPanic(
	t TestingT,
	want string,
	fn func(),
)

ExpectPanic asserts that a function panics with a specific value.

Types

type TestingT

type TestingT interface {
	Helper()
	Fatal(args ...any)
	Log(args ...any)
	Failed() bool
}

TestingT is the subset of testing.TB needed by these helpers.

Jump to

Keyboard shortcuts

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