Documentation ¶
Overview ¶
Package assert is a helper package for test assertions.
On failure, every assertion will fatal the test.
The name parameter is available in each assertion for easier debugging.
Index ¶
- func Equal(t testing.TB, name string, exp, act interface{}, opts ...cmp.Option)
- func Error(t testing.TB, name string, err error)
- func ErrorContains(t testing.TB, name string, err error, sub string)
- func False(t testing.TB, name string, act bool)
- func Success(t testing.TB, name string, err error)
- func True(t testing.TB, name string, act bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Equal ¶
Equal asserts exp == act.
If they are not equal, it will fatal the test with a diff of the two objects.
Errors will be compared with errors.Is.
func ErrorContains ¶ added in v1.2.0
ErrorContains asserts err != nil and err.Error() contains sub.
The match will be case insensitive.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.