Documentation ¶
Index ¶
- func Equal(t testing.TB, want, got interface{}, msgAndArgs ...interface{})
- func Error(t testing.TB, err error, msgAndArgs ...interface{})
- func Eventually(t testing.TB, condition func(ctx context.Context) bool, ...)
- func False(t testing.TB, ok bool, msgAndArgs ...interface{})
- func Never(t testing.TB, condition func(ctx context.Context) bool, ...)
- func NoError(t testing.TB, err error, msgAndArgs ...interface{})
- func NotEqual(t testing.TB, want, got interface{}, msgAndArgs ...interface{})
- func NotPanics(t testing.TB, f PanicTestFunc, msgAndArgs ...interface{})
- func NotRegexp(t testing.TB, rx interface{}, str string, msgAndArgs ...interface{})
- func Panics(t testing.TB, f PanicTestFunc, msgAndArgs ...interface{})
- func Regexp(t testing.TB, rx interface{}, str string, msgAndArgs ...interface{})
- func True(t testing.TB, ok bool, msgAndArgs ...interface{})
- type As
- func (c *As) Equal(want, got interface{}, msgAndArgs ...interface{})
- func (c *As) Error(err error, msgAndArgs ...interface{})
- func (c *As) Eventually(condition func(ctx context.Context) bool, waitFor, tick time.Duration, ...)
- func (a *As) FailDirectly(b bool) *As
- func (c *As) False(ok bool, msgAndArgs ...interface{})
- func (c *As) Never(condition func(ctx context.Context) bool, waitFor, tick time.Duration, ...)
- func (c *As) NoError(err error, msgAndArgs ...interface{})
- func (c *As) NotEqual(want, got interface{}, msgAndArgs ...interface{})
- func (c *As) NotPanics(f PanicTestFunc, msgAndArgs ...interface{})
- func (c *As) NotRegexp(rx interface{}, str string, msgAndArgs ...interface{})
- func (c *As) Panics(f PanicTestFunc, msgAndArgs ...interface{})
- func (c *As) Regexp(rx interface{}, str string, msgAndArgs ...interface{})
- func (c *As) True(ok bool, msgAndArgs ...interface{})
- type PanicTestFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Eventually ¶
func Eventually(t testing.TB, condition func(ctx context.Context) bool, waitFor, checkInterval time.Duration, msgAndArgs ...interface{})
Eventually asserts that given condition will be met in waitFor time, periodically checking target function each tick.
func Never ¶
func Never(t testing.TB, condition func(ctx context.Context) bool, waitFor, checkInterval time.Duration, msgAndArgs ...interface{})
Never asserts that the given condition doesn't satisfy in waitFor time, periodically checking the target function each tick.
func NotPanics ¶
func NotPanics(t testing.TB, f PanicTestFunc, msgAndArgs ...interface{})
NotPanics asserts that the code inside the specified PanicTestFunc does not panic.
func Panics ¶
func Panics(t testing.TB, f PanicTestFunc, msgAndArgs ...interface{})
Panics asserts that the code inside the specified PanicTestFunc panics.
Types ¶
type As ¶
As provides check methods around the testing.TB interface.
func (*As) Equal ¶
func (c *As) Equal(want, got interface{}, msgAndArgs ...interface{})
Equal checks that two objects are equal.
func (*As) Eventually ¶
func (c *As) Eventually(condition func(ctx context.Context) bool, waitFor, tick time.Duration, msgAndArgs ...interface{})
Eventually checks that given condition will be met in waitFor time, periodically checking target function each tick.
func (*As) FailDirectly ¶
FailDirectly specified fail directly for checks of as object.
func (*As) Never ¶
func (c *As) Never(condition func(ctx context.Context) bool, waitFor, tick time.Duration, msgAndArgs ...interface{})
Never checks that the given condition doesn't satisfy in waitFor time, periodically checking the target function each tick.
func (*As) NotEqual ¶
func (c *As) NotEqual(want, got interface{}, msgAndArgs ...interface{})
Equal checks that two objects are not equal.
func (*As) NotPanics ¶
func (c *As) NotPanics(f PanicTestFunc, msgAndArgs ...interface{})
NotPanics checks that the code inside the specified PanicTestFunc does not panic.
func (*As) Panics ¶
func (c *As) Panics(f PanicTestFunc, msgAndArgs ...interface{})
Panics checks that the code inside the specified PanicTestFunc panics.
type PanicTestFunc ¶
type PanicTestFunc func()
PanicTestFunc defines a func that should be passed to the as.Panics and as.NotPanics methods, and represents a simple func that takes no arguments, and returns nothing.