testing

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package testing provides testing helpers for state machines using testify.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertErr

func AssertErr(t *stdtest.T, mach am.Api)

AssertErr asserts that the machine is in the Exception state.

func AssertIs

func AssertIs(t *stdtest.T, mach am.Api, states am.S)

AssertIs asserts that the machine is in the given states.

func AssertIs1

func AssertIs1(t *stdtest.T, mach am.Api, state string)

AssertIs1 asserts that the machine is in the given state.

func AssertNoErrEver

func AssertNoErrEver(t *stdtest.T, mach am.Api)

AssertNoErrEver asserts that the machine never was in the Exception state.

func AssertNoErrNow

func AssertNoErrNow(t *stdtest.T, mach am.Api)

AssertNoErrNow asserts that the machine is not in the Exception state.

func AssertNot

func AssertNot(t *stdtest.T, mach am.Api, states am.S)

AssertNot asserts that the machine is not in the given states.

func AssertNot1

func AssertNot1(t *stdtest.T, mach am.Api, state string)

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

func MachDebug(t *stdtest.T, mach am.Api, amDbgAddr string,
	logLvl am.LogLevel, stdout bool,
)

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

func MachDebugEnv(t *stdtest.T, mach am.Api)

MachDebugEnv sets up a machine for debugging in tests, based on env vars only: AM_DBG_ADDR, AM_LOG, and AM_DEBUG.

func Wait

func Wait(
	t *stdtest.T, errMsg string, ctx context.Context, length time.Duration,
)

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.

func WaitForErrAll

func WaitForErrAll(
	t *stdtest.T, source string, ctx context.Context, mach am.Api,
	timeout time.Duration, chans ...<-chan struct{},
)

WaitForErrAll is a test version of amhelp.WaitForErrAll, which errors instead of returning an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL