Documentation
¶
Overview ¶
Package actiontest helps the tests of the built-in actions keep what each declares of itself to what it does.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckFields ¶
CheckFields fails t when ret, what an action returned for a step, has a field of req or of res that req and res, the fields the action declares, leave out. with is the step's with, whose keys are fields too of an action that returns what it is given, or nil for one that does not.
func CheckRequired ¶
func CheckRequired(t testing.TB, required [][]string, with map[string]any, run func(with map[string]any) error)
CheckRequired fails t unless run, given with without the keys of each group of required, fails for a want of one of them, before it does anything: its error names the key. with holds a key of every group, so that it is the missing one the action fails for.
Types ¶
type Kinds ¶
type Kinds struct {
// contains filtered or unexported fields
}
Kinds checks that the fields of the req and the res an action returns are of the kinds it declares, as the runner receives them: after they have been sent from the action's process, which sends a time.Duration as text and every number as one kind. A field that is nil, as one an action leaves empty may be, is of any kind.
func NewKinds ¶
NewKinds returns a Kinds that checks what an action returns against req and res, the kinds of the fields of its req and res it declares.