Documentation
¶
Index ¶
- type ITestingAware
- type Node
- type NodePath
- func (c NodePath[Q, R, TC]) Assert(t testing_ctx.T, tctx *TC, req *Q, resp *R, err error)
- func (c NodePath[Q, R, TC]) Parent() NodePath[Q, R, TC]
- func (c NodePath[Q, R, TC]) Run(t testing_ctx.T)
- func (c NodePath[Q, R, TC]) Runner() func(t testing_ctx.T, tctx *TC, req *Q) (*R, error)
- func (c NodePath[Q, R, TC]) Setup(t testing_ctx.T) (*Q, *TC)
- type PanicError
- type Tree
- func (c *Tree[Q, R, TC]) FindNode(id string) *Node[Q, R, TC]
- func (c *Tree[Q, R, TC]) GetNodePath(node *Node[Q, R, TC]) NodePath[Q, R, TC]
- func (c *Tree[Q, R, TC]) GetPath(id string) NodePath[Q, R, TC]
- func (c *Tree[Q, R, TC]) Run(t testing_ctx.T)
- func (c *Tree[Q, R, TC]) RunNode(t testing_ctx.T, node *Node[Q, R, TC])
- func (t *Tree[Q, R, TC]) ServeSVG() error
- func (t *Tree[Q, R, TC]) ToDecisionTree() *decision_tree.Node
- func (c *Tree[Q, R, TC]) ToMermaid() string
- func (t *Tree[Q, R, TC]) ToSVG() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ITestingAware ¶
type ITestingAware interface {
OnTestingInit(t testing_ctx.T)
}
type Node ¶
type Node[Q any, R any, TC any] struct { ID string ParentID string // only required in detached mode ParentNode *Node[Q, R, TC] // optional with ParentID. If both set, they must match InheritAssert bool // by default assert is not inherited Description string Tags []string // for grouping Run func(t testing_ctx.T, tctx *TC, req *Q) (*R, error) Setup func(t testing_ctx.T, tctx *TC, req *Q) (*TC, *Q) Assert func(t testing_ctx.T, tctx *TC, req *Q, res *R, err error) Children []*Node[Q, R, TC] }
Node defines a node in the tree of testing cases Q: request R: response TC: testing context
type NodePath ¶ added in v0.0.19
func (NodePath[Q, R, TC]) Assert ¶ added in v0.0.19
func (c NodePath[Q, R, TC]) Assert(t testing_ctx.T, tctx *TC, req *Q, resp *R, err error)
func (NodePath[Q, R, TC]) Run ¶ added in v0.0.19
func (c NodePath[Q, R, TC]) Run(t testing_ctx.T)
func (NodePath[Q, R, TC]) Runner ¶ added in v0.0.19
func (c NodePath[Q, R, TC]) Runner() func(t testing_ctx.T, tctx *TC, req *Q) (*R, error)
func (NodePath[Q, R, TC]) Setup ¶ added in v0.0.19
func (c NodePath[Q, R, TC]) Setup(t testing_ctx.T) (*Q, *TC)
type PanicError ¶ added in v0.0.24
type PanicError struct { Arg interface{} Stack []byte }
func (*PanicError) Error ¶ added in v0.0.24
func (c *PanicError) Error() string
func (*PanicError) Unwrap ¶ added in v0.0.24
func (c *PanicError) Unwrap() error
type Tree ¶
type Tree[Q any, R any, TC any] struct { Root *Node[Q, R, TC] // contains filtered or unexported fields }
func Build ¶
func Build[Q any, R any, TC any](root *Node[Q, R, TC], nodes []*Node[Q, R, TC]) (*Tree[Q, R, TC], error)
Build builds a tree from a list of nodes. The root node is the node without parent If multiple nodes defined no
func (*Tree[Q, R, TC]) GetNodePath ¶ added in v0.0.19
func (*Tree[Q, R, TC]) Run ¶
func (c *Tree[Q, R, TC]) Run(t testing_ctx.T)
func (*Tree[Q, R, TC]) RunNode ¶
func (c *Tree[Q, R, TC]) RunNode(t testing_ctx.T, node *Node[Q, R, TC])
func (*Tree[Q, R, TC]) ServeSVG ¶ added in v0.0.18
ServeSVG generates an SVG representation of the tree and serves it on a local server
func (*Tree[Q, R, TC]) ToDecisionTree ¶ added in v0.0.18
func (t *Tree[Q, R, TC]) ToDecisionTree() *decision_tree.Node
ToDecisionTree converts a t_tree.Tree to a decision_tree.Node This allows us to leverage the visualization capabilities of the decision_tree package
Click to show internal directories.
Click to hide internal directories.