assert

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package assert provides lightweight test assertions used by the root module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(t testingT, container, item any, msgAndArgs ...any) bool

Contains reports whether container contains item.

func Empty

func Empty(t testingT, object any, msgAndArgs ...any) bool

Empty reports whether object is empty or zero.

func Equal

func Equal(t testingT, expected, actual any, msgAndArgs ...any) bool

Equal reports whether expected and actual are deeply equal.

func Error

func Error(t testingT, err error, msgAndArgs ...any) bool

Error reports whether err is non-nil.

func ErrorIs

func ErrorIs(t testingT, err, target error, msgAndArgs ...any) bool

ErrorIs reports whether err matches target.

func False

func False(t testingT, value bool, msgAndArgs ...any) bool

False reports whether value is false.

func Greater

func Greater(t testingT, actual, expected any, msgAndArgs ...any) bool

Greater reports whether actual is greater than expected.

func GreaterOrEqual

func GreaterOrEqual(t testingT, actual, expected any, msgAndArgs ...any) bool

GreaterOrEqual reports whether actual is greater than or equal to expected.

func Implements

func Implements(t testingT, interfaceObject, object any, msgAndArgs ...any) bool

Implements reports whether object implements interfaceObject.

func InDelta

func InDelta(t testingT, expected, actual, delta any, msgAndArgs ...any) bool

InDelta reports whether expected and actual differ by at most delta.

func InDeltaSlice

func InDeltaSlice(t testingT, expected, actual any, delta float64, msgAndArgs ...any) bool

InDeltaSlice reports whether numeric slices differ element-wise by at most delta.

func IsType

func IsType(t testingT, expectedType, object any, msgAndArgs ...any) bool

IsType reports whether expectedType and object have the same dynamic type.

func Len

func Len(t testingT, object any, length int, msgAndArgs ...any) bool

Len reports whether object length equals expected.

func Less

func Less(t testingT, actual, expected any, msgAndArgs ...any) bool

Less reports whether actual is less than expected.

func LessOrEqual

func LessOrEqual(t testingT, actual, expected any, msgAndArgs ...any) bool

LessOrEqual reports whether actual is less than or equal to expected.

func Nil

func Nil(t testingT, value any, msgAndArgs ...any) bool

Nil reports whether value is nil.

func NoError

func NoError(t testingT, err error, msgAndArgs ...any) bool

NoError reports whether err is nil.

func NotContains

func NotContains(t testingT, container, item any, msgAndArgs ...any) bool

NotContains reports whether container does not contain item.

func NotEmpty

func NotEmpty(t testingT, object any, msgAndArgs ...any) bool

NotEmpty reports whether object is not empty.

func NotEqual

func NotEqual(t testingT, expected, actual any, msgAndArgs ...any) bool

NotEqual reports whether expected and actual are not deeply equal.

func NotNil

func NotNil(t testingT, value any, msgAndArgs ...any) bool

NotNil reports whether value is not nil.

func NotPanics

func NotPanics(t testingT, fn func(), msgAndArgs ...any) bool

NotPanics reports whether fn does not panic.

func NotSame

func NotSame(t testingT, expected, actual any, msgAndArgs ...any) bool

NotSame reports whether expected and actual are different objects.

func Regexp

func Regexp(t testingT, rx any, str any, msgAndArgs ...any) bool

Regexp reports whether str matches rx.

func Same

func Same(t testingT, expected, actual any, msgAndArgs ...any) bool

Same reports whether expected and actual are the same object.

func True

func True(t testingT, value bool, msgAndArgs ...any) bool

True reports whether value is true.

func Zero

func Zero(t testingT, value any, msgAndArgs ...any) bool

Zero reports whether value is the zero value for its type.

Types

This section is empty.

Jump to

Keyboard shortcuts

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