check

package
v0.0.0-...-69ad13d Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(t Error, iter, v any) bool

Check that iter contains value v. Iter must be one of: map, slice, array, or string.

func Containsf

func Containsf(t Error, iter, v any, format string, args ...any) bool

Check that iter contains value v. Iter must be one of: map, slice, array, or string.

func Equal

func Equal(t Error, g, e any) bool

Check that two things are equal; e is the expected value, g is what was got.

func Equalf

func Equalf(t Error, g, e any, format string, args ...any) bool

Check that two things are equal; e is the expected value, g is what was got.

func ErrAs

func ErrAs(t Error, err error, target any) bool

Check that errors.As returns true.

func ErrAsf

func ErrAsf(t Error, err error, target any, format string, args ...any) bool

Check that errors.As returns true.

func ErrIs

func ErrIs(t Error, err, target error) bool

Check that errors.Is returns true.

func ErrIsf

func ErrIsf(t Error, err, target error, format string, args ...any) bool

Check that errors.Is returns true.

func EventuallyNil

func EventuallyNil(t Error, numTries int, fn func(i int) error) bool

Poll the given function, a max of numTries times, until it doesn't return an error. This is mainly a helper used to exhaust error pathways.

func EventuallyNilf

func EventuallyNilf(t Error, numTries int, fn func(i int) error, format string, args ...any) bool

Poll the given function, a max of numTries times, until it doesn't return an error. This is mainly a helper used to exhaust error pathways.

func EventuallyTrue

func EventuallyTrue(t Error, numTries int, fn func(i int) bool) bool

Poll the given function, a max of numTries times, until it returns true.

func EventuallyTruef

func EventuallyTruef(t Error, numTries int, fn func(i int) bool, format string, args ...any) bool

Poll the given function, a max of numTries times, until it returns true.

func False

func False(t Error, cond bool) bool

Check that the given bool is false.

func Falsef

func Falsef(t Error, cond bool, format string, args ...any) bool

Check that the given bool is false.

func HasKey

func HasKey(t Error, m, k any) bool

Check that map m contains key k.

func HasKeyf

func HasKeyf(t Error, m, k any, format string, args ...any) bool

Check that map m contains key k.

func MustContain

func MustContain(t Fatal, iter, v any)

Check that iter contains value v. Iter must be one of: map, slice, array, or string.

func MustContainf

func MustContainf(t Fatal, iter, v any, format string, args ...any)

Check that iter contains value v. Iter must be one of: map, slice, array, or string.

func MustEqual

func MustEqual(t Fatal, g, e any)

Check that two things are equal; e is the expected value, g is what was got.

func MustEqualf

func MustEqualf(t Fatal, g, e any, format string, args ...any)

Check that two things are equal; e is the expected value, g is what was got.

func MustErrAs

func MustErrAs(t Fatal, err error, target any)

Check that errors.As returns true.

func MustErrAsf

func MustErrAsf(t Fatal, err error, target any, format string, args ...any)

Check that errors.As returns true.

func MustErrIs

func MustErrIs(t Fatal, err, target error)

Check that errors.Is returns true.

func MustErrIsf

func MustErrIsf(t Fatal, err, target error, format string, args ...any)

Check that errors.Is returns true.

func MustEventuallyNil

func MustEventuallyNil(t Fatal, numTries int, fn func(i int) error)

Poll the given function, a max of numTries times, until it doesn't return an error. This is mainly a helper used to exhaust error pathways.

func MustEventuallyNilf

func MustEventuallyNilf(t Fatal, numTries int, fn func(i int) error, format string, args ...any)

Poll the given function, a max of numTries times, until it doesn't return an error. This is mainly a helper used to exhaust error pathways.

func MustEventuallyTrue

func MustEventuallyTrue(t Fatal, numTries int, fn func(i int) bool)

Poll the given function, a max of numTries times, until it returns true.

func MustEventuallyTruef

func MustEventuallyTruef(t Fatal, numTries int, fn func(i int) bool, format string, args ...any)

Poll the given function, a max of numTries times, until it returns true.

func MustFalse

func MustFalse(t Fatal, cond bool)

Check that the given bool is false.

func MustFalsef

func MustFalsef(t Fatal, cond bool, format string, args ...any)

Check that the given bool is false.

func MustHaveKey

func MustHaveKey(t Fatal, m, k any)

Check that map m contains key k.

func MustHaveKeyf

func MustHaveKeyf(t Fatal, m, k any, format string, args ...any)

Check that map m contains key k.

func MustNil

func MustNil(t Fatal, v any)

Check that v is nil. This is a strict equality check.

func MustNilf

func MustNilf(t Fatal, v any, format string, args ...any)

Check that v is nil. This is a strict equality check.

func MustNotContain

func MustNotContain(t Fatal, iter, v any)

Check that iter does not contain value v. Iter must be one of: map, slice, array, or string

func MustNotContainf

func MustNotContainf(t Fatal, iter, v any, format string, args ...any)

Check that iter does not contain value v. Iter must be one of: map, slice, array, or string

func MustNotEqual

func MustNotEqual(t Fatal, g, e any)

Check that two things are not equal; e is the expected value, g is what was got.

func MustNotEqualf

func MustNotEqualf(t Fatal, g, e any, format string, args ...any)

Check that two things are not equal; e is the expected value, g is what was got.

func MustNotHaveKey

func MustNotHaveKey(t Fatal, m, k any)

Check that map m does not contain key k.

func MustNotHaveKeyf

func MustNotHaveKeyf(t Fatal, m, k any, format string, args ...any)

Check that map m does not contain key k.

func MustNotNil

func MustNotNil(t Fatal, v any)

Check that v is not nil. This is a strict equality check.

func MustNotNilf

func MustNotNilf(t Fatal, v any, format string, args ...any)

Check that v is not nil. This is a strict equality check.

func MustNotPanic

func MustNotPanic(t Fatal, fn func())

Check that the given function does not panic.

func MustNotPanicf

func MustNotPanicf(t Fatal, fn func(), format string, args ...any)

Check that the given function does not panic.

func MustPanic

func MustPanic(t Fatal, fn func())

Check that the given function panics.

func MustPanicWith

func MustPanicWith(t Fatal, recovers any, fn func())

Check that the given function panics with the given value.

func MustPanicWithf

func MustPanicWithf(t Fatal, recovers any, fn func(), format string, args ...any)

Check that the given function panics with the given value.

func MustPanicf

func MustPanicf(t Fatal, fn func(), format string, args ...any)

Check that the given function panics.

func MustTrue

func MustTrue(t Fatal, cond bool)

Check that the given bool is true.

func MustTruef

func MustTruef(t Fatal, cond bool, format string, args ...any)

Check that the given bool is true.

func Nil

func Nil(t Error, v any) bool

Check that v is nil. This is a strict equality check.

func Nilf

func Nilf(t Error, v any, format string, args ...any) bool

Check that v is nil. This is a strict equality check.

func NotContains

func NotContains(t Error, iter, v any) bool

Check that iter does not contain value v. Iter must be one of: map, slice, array, or string

func NotContainsf

func NotContainsf(t Error, iter, v any, format string, args ...any) bool

Check that iter does not contain value v. Iter must be one of: map, slice, array, or string

func NotEqual

func NotEqual(t Error, g, e any) bool

Check that two things are not equal; e is the expected value, g is what was got.

func NotEqualf

func NotEqualf(t Error, g, e any, format string, args ...any) bool

Check that two things are not equal; e is the expected value, g is what was got.

func NotHasKey

func NotHasKey(t Error, m, k any) bool

Check that map m does not contain key k.

func NotHasKeyf

func NotHasKeyf(t Error, m, k any, format string, args ...any) bool

Check that map m does not contain key k.

func NotNil

func NotNil(t Error, v any) bool

Check that v is not nil. This is a strict equality check.

func NotNilf

func NotNilf(t Error, v any, format string, args ...any) bool

Check that v is not nil. This is a strict equality check.

func NotPanics

func NotPanics(t Error, fn func()) bool

Check that the given function does not panic.

func NotPanicsf

func NotPanicsf(t Error, fn func(), format string, args ...any) bool

Check that the given function does not panic.

func Panics

func Panics(t Error, fn func()) bool

Check that the given function panics.

func PanicsWith

func PanicsWith(t Error, recovers any, fn func()) bool

Check that the given function panics with the given value.

func PanicsWithf

func PanicsWithf(t Error, recovers any, fn func(), format string, args ...any) bool

Check that the given function panics with the given value.

func Panicsf

func Panicsf(t Error, fn func(), format string, args ...any) bool

Check that the given function panics.

func True

func True(t Error, cond bool) bool

Check that the given bool is true.

func Truef

func Truef(t Error, cond bool, format string, args ...any) bool

Check that the given bool is true.

Types

type Error

type Error interface {
	Helper()
	Error(args ...any)
}

type Fatal

type Fatal interface {
	Helper()
	Fatal(args ...any)
}

Jump to

Keyboard shortcuts

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