Documentation
¶
Index ¶
- func AssertEqual[C comparable](t *testing.T, expected, actual C)
- func AssertEqualSlice[C comparable](t *testing.T, expected, actual []C)
- func AssertErrorMsg(t *testing.T, err error, msg string)
- func AssertNoDiff[T any](t *testing.T, expected, actual T)
- func AssertNoError(t *testing.T, err error, msg ...string)
- func Callers() string
- func CompareGolden(t *testing.T, data []byte, ext string)
- func Contains[C comparable](t *testing.T, haystack []C, needle C)
- func Diff[T any](expected, actual T, opts ...cmp.Option) string
- func ErrorIs(t *testing.T, err, expected error)
- func False(t *testing.T, condition bool, msg string)
- func Golden(t *testing.T, data []byte, ext string)
- func IsEqual[C comparable](t *testing.T, expected, actual C)
- func IsNil(t *testing.T, obj any)
- func IsNotEqual[C comparable](t *testing.T, expected, actual C)
- func IsNotNil(t *testing.T, obj any)
- func NotContains[C comparable](t *testing.T, haystack []C, needle C)
- func True(t *testing.T, condition bool, msg string)
- func UpdateGolden(t *testing.T, data []byte, ext string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertEqual ¶
func AssertEqual[C comparable](t *testing.T, expected, actual C)
AssertEqual checks if the expected and actual are equal. Errors if not.
func AssertEqualSlice ¶
func AssertEqualSlice[C comparable](t *testing.T, expected, actual []C)
AssertEqualSlice checks if the expected and actual slices are equal. Errors if not.
func AssertErrorMsg ¶
AssertErrorMsg checks if the error is not nil.
func AssertNoDiff ¶
func AssertNoError ¶
AssertNoError checks if the error is nil.
func Callers ¶
func Callers() string
Callers prints the stack trace of everything up til the line where Callers() was invoked.
func Contains ¶
func Contains[C comparable](t *testing.T, haystack []C, needle C)
Contains checks if the needle is in the haystack. Errors if not.
func Diff ¶
Diff compares two items and returns a human-readable diff string. If the items are equal, the string is empty.
func IsEqual ¶
func IsEqual[C comparable](t *testing.T, expected, actual C)
IsEqual checks if the expected and actual are equal. Errors if not.
func IsNotEqual ¶
func IsNotEqual[C comparable](t *testing.T, expected, actual C)
IsNotEqual checks if the expected and actual are not equal. Errors if not.
func NotContains ¶
func NotContains[C comparable](t *testing.T, haystack []C, needle C)
NotContains checks if the needle is not in the haystack. Errors if it is.
Types ¶
This section is empty.