assert

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: ISC Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolIs

func BoolIs(t testing.TB, got, want bool)

BoolIs asserts the given bool value.

func Chan2NotWritten

func Chan2NotWritten[T any, U any](t testing.TB, c chan T, d chan U, timeout time.Duration)

Chan2NotWritten asserts that the chans are not written at least until the passed timeout value.

func ChanNotWritten

func ChanNotWritten[T any](t testing.TB, c chan T, timeout time.Duration)

ChanNotWritten asserts that the chan is not written at least until the passed timeout value.

func ChanWritten

func ChanWritten[T any](t testing.TB, c chan T) T

ChanWritten returns the value written to chan c or times out.

func ContextDone

func ContextDone(t testing.TB, ctx context.Context)

ContextDone asserts the passed context is done.

func DeepEqual

func DeepEqual[T any](t testing.TB, got, want T)

DeepEqual asserts got is reflect.DeepEqual to want.

func DoesNotBlock

func DoesNotBlock(t testing.TB, f func())

DoesNotBlock asserts that calling f() does not block for an inordinate amount of time.

func ErrorIs

func ErrorIs(t testing.TB, got, want error)

ErrorIs asserts that errors.Is(got, want).

func NilErr

func NilErr(t testing.TB, err error)

NilErr fails the test if err is non-nil.

func NilErrFromChan

func NilErrFromChan(t testing.TB, errChan chan error)

NilErrFromChan fails the test if a non-nil error is received in the chan or if the channel fails to be written to in 30 seconds.

Types

This section is empty.

Jump to

Keyboard shortcuts

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