Documentation ¶
Overview ¶
Package assert contains common assertions on builtin types.
Index ¶
- func Contains(tb testing.TB, collection, item interface{}) bool
- func Equal(tb testing.TB, expected, actual interface{}, args ...interface{}) bool
- func Error(tb testing.TB, err error) bool
- func ErrorIs(tb testing.TB, target, err error) bool
- func Eventually(tb testing.TB, fn func(context.Context) bool, totalWait time.Duration, ...) bool
- func IsType(tb testing.TB, expected, actual interface{}) bool
- func NoError(tb testing.TB, err error, args ...interface{}) bool
- func NotContains(tb testing.TB, collection, item interface{}) bool
- func NotEqual(tb testing.TB, expected, actual interface{}, args ...interface{}) bool
- func NotPanics(tb testing.TB, fn func()) bool
- func NotZero(tb testing.TB, value interface{}) bool
- func Panics(tb testing.TB, fn func()) (panicked bool)
- func Prefix(tb testing.TB, expected, actual string) bool
- func Subset(tb testing.TB, sub, super interface{}) bool
- func Suffix(tb testing.TB, expected, actual string) bool
- func Zero(tb testing.TB, value interface{}) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorIs ¶ added in v0.1.3
ErrorIs asserts 'err' matches the expected 'target'. Uses errors.Is().
func Eventually ¶
func Eventually(tb testing.TB, fn func(context.Context) bool, totalWait time.Duration, checkInterval time.Duration) bool
Eventually asserts fn() returns true within totalWait time, checking at the given interval
func NotContains ¶
NotContains asserts item is not contained by collection
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.