tester

package
v0.0.0-...-61a3e3c Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllPass = "all labels will pass if provided this magic string"

AllPass will always pass the test.

View Source
var AnyVal = anyVal{}

AnyVal will pass the test so long as the key for this value exists.

Functions

func Contains

func Contains(
	t errLogfer,
	errOrCtx any,
	kvs ...any,
) bool

Contains checks whether the errOrCtx (which should contain either an error or context.Context) contains the provided key:value pairs.

Returns true if the test fails.

func ContainsLabels

func ContainsLabels(
	t errLogfer,
	err error,
	expected ...string,
) bool

ContainsLabels checks whether the error(which should contain a cluerr.Err) contains the labels. If provided zero labels to check against, asserts that the error contains zero labels. Can be provided tester.AllPass to skip the check for a single test case.

Returns true if the test fails.

func ContainsMap

func ContainsMap(
	t errLogfer,
	errOrCtx any,
	m map[string]any,
) bool

Contains checks whether the errOrCtx (which should contain either an error or context.Context) contains the provided map.

Returns true if the test fails.

Types

This section is empty.

Jump to

Keyboard shortcuts

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