assert

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

README

assert

Go Reference Go Report Card CI

The assert library for golang testing.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assert

type Assert[TWant any] struct {
	// contains filtered or unexported fields
}

func All

func All[T any](conds ...Assert[T]) Assert[T]

func Any

func Any[T any](conds ...Assert[T]) Assert[T]

func Contain

func Contain[T comparable](want T) Assert[[]T]

func Equal

func Equal[T comparable](want T) Assert[T]

func Func

func Func[T any](fn func(got T) bool) Assert[T]

func IsError

func IsError(want error) Assert[error]

func IsNil

func IsNil[T any]() Assert[T]

func Len

func Len[T any](want int) Assert[[]T]

func (Assert[TWant]) Check

func (a Assert[TWant]) Check(t T, v TWant, msg ...any)

func (Assert[TWant]) Checkf

func (a Assert[TWant]) Checkf(t T, v TWant, format string, msg ...any)

func (Assert[TWant]) Ensure

func (a Assert[TWant]) Ensure(t T, v TWant, msg ...any)

func (Assert[TWant]) Ensuref

func (a Assert[TWant]) Ensuref(t T, v TWant, format string, msg ...any)

type T

type T interface {
	Helper()
	Log(args ...any)
	Logf(format string, args ...any)
	Error(args ...any)
	Errorf(format string, args ...any)
	Fatal(args ...any)
	Fatalf(format string, args ...any)
}

Jump to

Keyboard shortcuts

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