Documentation
¶
Overview ¶
Package require provides assertion helpers that stop test execution on failure. For assertions that should allow the test to continue on failure, use the `assert` package.
Index ¶
- func Panic(t internal.TestingT, fn func(), expr string, msg ...string)
- func That(t internal.TestingT, v any) *assert.Assertion
- func ThatError(t internal.TestingT, v error) *assert.ErrorAssertion
- func ThatMap[K, V comparable](t internal.TestingT, v map[K]V) *assert.MapAssertion[K, V]
- func ThatNumber[T assert.Number](t internal.TestingT, v T) *assert.NumberAssertion[T]
- func ThatSlice[T comparable](t internal.TestingT, v []T) *assert.SliceAssertion[T]
- func ThatString(t internal.TestingT, v string) *assert.StringAssertion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Panic ¶
Panic asserts that fn panics and the panic message matches expr. It reports an error if fn does not panic or if the recovered message does not satisfy expr.
func ThatError ¶
func ThatError(t internal.TestingT, v error) *assert.ErrorAssertion
ThatError returns a new ErrorAssertion for the given error value.
func ThatMap ¶
func ThatMap[K, V comparable](t internal.TestingT, v map[K]V) *assert.MapAssertion[K, V]
ThatMap returns a MapAssertion for the given testing object and map value.
func ThatNumber ¶
ThatNumber returns a NumberAssertion for the given testing object and number value.
func ThatSlice ¶
func ThatSlice[T comparable](t internal.TestingT, v []T) *assert.SliceAssertion[T]
ThatSlice returns a SliceAssertion for the given testing object and slice value.
func ThatString ¶
func ThatString(t internal.TestingT, v string) *assert.StringAssertion
ThatString returns a StringAssertion for the given testing object and string value.
Types ¶
This section is empty.