Documentation ¶
Overview ¶
* This package provides "assertions" for use in [erltest.TestExpectation]s. * * # Why is this needed? * * testing.T.FailNow requires that it be called from the goroutine running the test. Since * an erl process is by definition not going to execute in the test goroutine, we need to provide * alternative functions that can be used. This is basically an inversion of gotest.tools/v3/assert, * but replacing everything with Checks/returning a bool.
Index ¶
- func Assert(t *testing.T, comparison assert.BoolOrComparison, msgAndArgs ...any) bool
- func Chain(t *testing.T, checks ...bool) bool
- func Contains(t *testing.T, collection any, item any, msgAndArgs ...any) bool
- func DeepEqual(t *testing.T, actual, expected any, opts ...gocmp.Option) bool
- func Equal(t *testing.T, actual, expected any, msgAndArgs ...any) bool
- func Error(t *testing.T, e error, expected string, msgAndArgs ...any) bool
- func ErrorContains(t *testing.T, e error, expected string, msgAndArgs ...any) bool
- func ErrorIs(t *testing.T, actual error, expected error) bool
- func Nil(t *testing.T, ptr any, msgAndArgs ...any) bool
- func NilError(t *testing.T, e error, msgAndArgs ...any) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
Works with finding an item in a collection OR a substring (uses strings.Contains under the hood)
func DeepEqual ¶
Compares two values using go-cmp/cmp
func ErrorContains ¶
returns true if [e] is error and [expected] is a substring of [e.Error]
Types ¶
This section is empty.