Documentation
¶
Overview ¶
Package testutil provides utility functions for testing in Go.
Index ¶
- Variables
- func AssertEqual[T cmp.Ordered](t *testing.T, expected, actual T, msgAndArgs ...interface{}) bool
- func AssertNil(t *testing.T, object interface{}, msgAndArgs ...interface{}) bool
- func AssertNotNil(t *testing.T, object interface{}, msgAndArgs ...interface{}) bool
- func AssertTrue(t *testing.T, condition bool, msgAndArgs ...interface{}) bool
- func RequireError(t *testing.T, err error, msgAndArgs ...interface{})
- func RequireErrorAs(t *testing.T, err error, target interface{}, msgAndArgs ...interface{})
- func RequireErrorIs(t *testing.T, err error, target error, msgAndArgs ...interface{})
- func RequireNoError(t *testing.T, err error, msgAndArgs ...interface{})
- func RequireNotNil(t *testing.T, object interface{}, msgAndArgs ...interface{})
- func RequirePanics(t *testing.T, f func(), msgAndArgs ...interface{}) bool
- func RequireTrue(t *testing.T, condition bool, msgAndArgs ...interface{})
- type T
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSample = errors.New("an error")
Functions ¶
func AssertEqual ¶
func AssertNotNil ¶
func RequireError ¶
func RequireErrorAs ¶ added in v0.3.0
func RequireErrorIs ¶
func RequireNoError ¶
func RequireNotNil ¶
func RequirePanics ¶ added in v0.3.0
func RequireTrue ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.