assert

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal[T comparable](t testing.TB, a, b T) bool

Equal asserts that a == b. Returns true if assertion passes.

func EqualNow

func EqualNow[T comparable](t testing.TB, a, b T)

EqualNow asserts that a == b, terminating test immediately otherwise.

func Error

func Error(t testing.TB, err error) bool

Error asserts that the provided value is an error. Returns true if assertion passes.

func ErrorNow

func ErrorNow(t testing.TB, err error)

ErrorNow asserts that the provided value is an error, terminating the test if this is not true.

func NoError

func NoError(t testing.TB, err error) bool

NoError asserts that the provided value is not an error. Returns true if assertion passes.

func NoErrorNow

func NoErrorNow(t testing.TB, err error)

NoErrorNow asserts that the provided value is not an error, terminating the test if this is not true.

func NotNil

func NotNil(t testing.TB, v any) bool

NotNil asserts that the value is not nil. Returns true if assertion passes.

func NotNilNow

func NotNilNow(t testing.TB, v any)

NotNilNow asserts that the value is not nil, terminating the test if it isn't.

func PanicsNow

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

PanicsNow asserts that the provided function panics, terminating the test immediately if it doesn't.

func Smaller

func Smaller[T constraints.Ordered](t testing.TB, a, b T) bool

Smaller asserts that a < b. Returns true if assertion passes.

func SmallerNow

func SmallerNow[T constraints.Ordered](t testing.TB, a, b T)

SmallerNow asserts that a < b, terminating test immediately otherwise.

func StringContains

func StringContains(t testing.TB, s, substr string) bool

StringContains asserts that substr is within s. Returns true if assertion passes.

func True

func True(t testing.TB, b bool, msg string) bool

True asserts that the value is true. Returns true if assertion passes.

func TrueNow

func TrueNow(t testing.TB, b bool, msg string)

TrueNow asserts that the value is true, terminating the test immediately if isn't.

Types

This section is empty.

Jump to

Keyboard shortcuts

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