Documentation
¶
Overview ¶
Package testutil provides utility functions for testing in Go.
Index ¶
- Variables
- func AssertEqual[V cmp.Ordered](t T, expected, actual V, msgAndArgs ...interface{}) bool
- func AssertNil(t T, object interface{}, msgAndArgs ...interface{}) bool
- func AssertNotNil(t T, object interface{}, msgAndArgs ...interface{}) bool
- func AssertTrue(t T, condition bool, msgAndArgs ...interface{}) bool
- func RequireError(t T, err error, msgAndArgs ...interface{})
- func RequireErrorAs(t T, err error, target interface{}, msgAndArgs ...interface{})
- func RequireErrorIs(t T, err error, target error, msgAndArgs ...interface{})
- func RequireNoError(t T, err error, msgAndArgs ...interface{})
- func RequireNotNil(t T, object interface{}, msgAndArgs ...interface{})
- func RequirePanics(t T, f func(), msgAndArgs ...interface{}) bool
- func RequireTrue(t 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 AssertTrue ¶
func RequireError ¶
func RequireErrorAs ¶ added in v0.3.0
func RequireErrorIs ¶
func RequireNoError ¶
func RequireNotNil ¶
func RequireNotNil(t T, object interface{}, msgAndArgs ...interface{})
func RequirePanics ¶ added in v0.3.0
func RequireTrue ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.