assert

package
v0.0.0-...-14b8f79 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal[T comparable](t *testing.T, expected, got T) bool

func EqualSeq2

func EqualSeq2[K, V any](t *testing.T, expected, got iter.Seq2[K, V], equal func(expected, got KeyValue[K, V]) bool) bool

func EqualSlice

func EqualSlice[T comparable](t *testing.T, expected, got []T) bool

func EqualSliceFunc

func EqualSliceFunc[T comparable](t *testing.T, expected, got []T, equal func(want, item T) bool) bool

func EqualTime

func EqualTime(t *testing.T, expected, got time.Time) bool

func Equalf

func Equalf[T comparable](t *testing.T, expected, got T, format string, args ...any) bool

func Error

func Error(t *testing.T, got error) bool

func Falsef

func Falsef(t *testing.T, got bool, format string, args ...any) bool

func MustNoError

func MustNoError[T any](t *testing.T, fn func() (T, error)) T

func NoError

func NoError(t *testing.T, got error) bool

func NoErrorEventually

func NoErrorEventually(t *testing.T, duration time.Duration, fn func() error) bool

NoErrorEventually retries fn up to 10 times over the given duration. It returns true if any call to fn returns nil. If all attempts fail, it logs the last error and fails the test.

func NoPanic

func NoPanic(t *testing.T, assert func())

func NotEqual

func NotEqual[T comparable](t *testing.T, unexpected, got T) bool

func NotNil

func NotNil(t *testing.T, got any) bool

func Panic

func Panic(t *testing.T, assert func())

func Truef

func Truef(t *testing.T, got bool, format string, args ...any) bool

Types

type KeyValue

type KeyValue[K, V any] struct {
	Key   K
	Value V
}

Jump to

Keyboard shortcuts

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