testutil

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertVarSubNode

func AssertVarSubNode(t *testing.T, want any, actual visit.VarSubNode, messageAndArgs ...any)

AssertVarSubNode checks if the given node is of the wanted type and value. This function does not abort the test on failing assertion

func NewKeyedNode

func NewKeyedNode(t *testing.T, content string) (visit.StringNode, *yaml.Node)

NewKeyedNode parses the YAML content and returns a new string key node and its child YAML node. Parsing failure will abort the test.

func NewNode

func NewNode(t *testing.T, content string) *yaml.Node

NewNode parses the YAML content and returns a node. Parsing failure will abort the test.

func RequireContainsErr

func RequireContainsErr(t *testing.T, errs errutil.Slice, err error)

RequireContainsErr fails the test if no error in the slice Is the given error.

func RequireNoErr

func RequireNoErr(t *testing.T, errs errutil.Slice)

RequireNoErr fails the test if the error slice is not empty.

func RequireNotContainsErr

func RequireNotContainsErr(t *testing.T, errs errutil.Slice, err error)

RequireNotContainsErr fails the test if any error in the slice Is the given error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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