check

package
v0.8.8 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MPL-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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