check

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package check provides a set of functions that can be used for error checking in table-driven test.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Check

type Check func(t xtesting.T, err error)

Check is a function that checks for an error or absence of it.

func EqualError

func EqualError(msg string) Check

EqualError returns a function that checks for a specific error text.

func ErrorAs

func ErrorAs[T error]() Check

ErrorAs returns a function that checks that error can be converted to a specific type.

func ErrorContains

func ErrorContains(msg string) Check

ErrorContains returns a function that checks that error message contains a specific text.

func ErrorIs

func ErrorIs(target error) Check

ErrorIs returns a function that checks that error is equal to a specific error.

func ErrorRegexp

func ErrorRegexp(rx any) Check

ErrorRegexp returns a function that checks that error message matches a specific regexp.

func ErrorTagIs

func ErrorTagIs[T xerrors.Tag]() Check

ErrorTagIs returns a function that checks that error has a specific tag.

func NoError

func NoError() Check

NoError returns a function that checks that no error happened.

Jump to

Keyboard shortcuts

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