Documentation
¶
Overview ¶
Package testing provides testing helpers for state machines using testify.
Index ¶
- func AssertErr(t *stdtest.T, mach am.Api)
- func AssertIs(t *stdtest.T, mach am.Api, states am.S)
- func AssertIs1(t *stdtest.T, mach am.Api, state string)
- func AssertNoErrEver(t *stdtest.T, mach am.Api)
- func AssertNoErrNow(t *stdtest.T, mach am.Api)
- func AssertNot(t *stdtest.T, mach am.Api, states am.S)
- func AssertNot1(t *stdtest.T, mach am.Api, state string)
- func GroupWhen1(t *stdtest.T, mach []am.Api, state string, ctx context.Context) []<-chan struct{}
- func MachDebug(t *stdtest.T, mach am.Api, amDbgAddr string, logLvl am.LogLevel, stdout bool)
- func MachDebugEnv(t *stdtest.T, mach am.Api)
- func Wait(t *stdtest.T, errMsg string, ctx context.Context, length time.Duration)
- func WaitForAll(t *stdtest.T, source string, ctx context.Context, timeout time.Duration, ...)
- func WaitForAny(t *stdtest.T, source string, ctx context.Context, timeout time.Duration, ...)
- func WaitForErrAll(t *stdtest.T, source string, ctx context.Context, mach am.Api, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertNoErrEver ¶
AssertNoErrEver asserts that the machine never was in the Exception state.
func AssertNoErrNow ¶
AssertNoErrNow asserts that the machine is not in the Exception state.
func AssertNot1 ¶
AssertNot1 asserts that the machine is not in the given state.
func GroupWhen1 ¶
func GroupWhen1( t *stdtest.T, mach []am.Api, state string, ctx context.Context, ) []<-chan struct{}
GroupWhen1 is a test version of amhelp.GroupWhen1, which errors instead of returning an error.
func MachDebug ¶
MachDebug sets up a machine for debugging in tests, based on the AM_DEBUG env var, passed am-dbg address, log level and stdout flag.
func MachDebugEnv ¶
MachDebugEnv sets up a machine for debugging in tests, based on env vars only: AM_DBG_ADDR, AM_LOG, and AM_DEBUG.
func Wait ¶
Wait is a test version of amhelp.Wait, which errors instead of returning false.
func WaitForAll ¶
func WaitForAll( t *stdtest.T, source string, ctx context.Context, timeout time.Duration, chans ...<-chan struct{}, )
WaitForAll is a test version of amhelp.WaitForAll, which errors instead of returning an error.
func WaitForAny ¶
func WaitForAny( t *stdtest.T, source string, ctx context.Context, timeout time.Duration, chans ...<-chan struct{}, )
WaitForAny is a test version of amhelp.WaitForAny, which errors instead of returning an error.
Types ¶
This section is empty.