assertions

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Caller

func Caller() string

func Contains added in v1.0.7

func Contains[C any](i C, c interfaces.ContainsFunc[C]) (s string)

func ContainsSubset added in v1.0.7

func ContainsSubset[C any](elements []C, container interfaces.ContainsFunc[C]) (s string)

func Empty added in v1.0.7

func Empty(e interfaces.EmptyFunc) (s string)

func Eq

func Eq[A any](exp, val A, opts ...cmp.Option) (s string)

func EqError

func EqError(err error, msg string) (s string)

func EqFunc

func EqFunc[A any](exp, val A, eq func(a, b A) bool) (s string)

func EqJSON

func EqJSON(exp, val string) (s string)

func EqOp

func EqOp[C comparable](exp, val C) (s string)

func EqSliceFunc

func EqSliceFunc[A, B any](exp []B, val []A, eq func(a A, b B) bool) (s string)

func Equal

func Equal[E interfaces.EqualFunc[E]](exp, val E) (s string)

func Error

func Error(err error) (s string)

func ErrorAs

func ErrorAs[E error, Target *E](err error, target Target) (s string)

func ErrorContains

func ErrorContains(err error, sub string) (s string)

func ErrorIs

func ErrorIs(err error, target error) (s string)

func False

func False(condition bool) (s string)

func Length added in v1.0.7

func Length(n int, length interfaces.LengthFunc) (s string)

func Lesser

func Lesser[L interfaces.LessFunc[L]](exp, val L) (s string)

func MapContainsKey

func MapContainsKey[M ~map[K]V, K comparable, V any](m M, key K) (s string)

func MapContainsKeys

func MapContainsKeys[M ~map[K]V, K comparable, V any](m M, keys []K) (s string)

func MapContainsValue

func MapContainsValue[M ~map[K]V, K comparable, V any](m M, val V, opts cmp.Options) (s string)

func MapContainsValueEqual

func MapContainsValueEqual[M ~map[K]V, K comparable, V interfaces.EqualFunc[V]](m M, val V) (s string)

func MapContainsValueFunc

func MapContainsValueFunc[M ~map[K]V, K comparable, V any](m M, val V, eq func(V, V) bool) (s string)

func MapContainsValues

func MapContainsValues[M ~map[K]V, K comparable, V any](m M, vals []V, opts cmp.Options) (s string)

func MapContainsValuesEqual

func MapContainsValuesEqual[M ~map[K]V, K comparable, V interfaces.EqualFunc[V]](m M, vals []V) (s string)

func MapContainsValuesFunc

func MapContainsValuesFunc[M ~map[K]V, K comparable, V any](m M, vals []V, eq func(V, V) bool) (s string)

func MapEmpty

func MapEmpty[M ~map[K]V, K comparable, V any](m M) (s string)

func MapEq

func MapEq[M1, M2 interfaces.Map[K, V], K comparable, V any](exp M1, val M2, opts cmp.Options) (s string)

func MapEqFunc

func MapEqFunc[M1, M2 interfaces.Map[K, V], K comparable, V any](exp M1, val M2, eq func(V, V) bool) (s string)

func MapEqOp

func MapEqOp[M interfaces.Map[K, V], K, V comparable](exp, val M) (s string)

func MapEqual

func MapEqual[M interfaces.MapEqualFunc[K, V], K comparable, V interfaces.EqualFunc[V]](exp, val M) (s string)

func MapLen

func MapLen[M ~map[K]V, K comparable, V any](n int, m M) (s string)

func MapNotContainsKey

func MapNotContainsKey[M ~map[K]V, K comparable, V any](m M, key K) (s string)

func MapNotContainsKeys

func MapNotContainsKeys[M ~map[K]V, K comparable, V any](m M, keys []K) (s string)

func MapNotContainsValue

func MapNotContainsValue[M ~map[K]V, K comparable, V any](m M, val V, opts cmp.Options) (s string)

func MapNotContainsValueEqual

func MapNotContainsValueEqual[M ~map[K]V, K comparable, V interfaces.EqualFunc[V]](m M, val V) (s string)

func MapNotContainsValueFunc

func MapNotContainsValueFunc[M ~map[K]V, K comparable, V any](m M, val V, eq func(V, V) bool) (s string)

func MapNotContainsValues

func MapNotContainsValues[M ~map[K]V, K comparable, V any](m M, vals []V, opts cmp.Options) (s string)

func MapNotContainsValuesEqual

func MapNotContainsValuesEqual[M ~map[K]V, K comparable, V interfaces.EqualFunc[V]](m M, vals []V) (s string)

func MapNotContainsValuesFunc

func MapNotContainsValuesFunc[M ~map[K]V, K comparable, V any](m M, vals []V, eq func(V, V) bool) (s string)

func MapNotEmpty

func MapNotEmpty[M ~map[K]V, K comparable, V any](m M) (s string)

func Nil

func Nil(val any) string

Asserts `val` is nil, else returns a message.

func NoError

func NoError(err error) (s string)

func NonZero

func NonZero[N interfaces.Number](value N) (s string)

func NotContains added in v1.0.7

func NotContains[C any](i C, c interfaces.ContainsFunc[C]) (s string)

func NotEmpty added in v1.0.7

func NotEmpty(e interfaces.EmptyFunc) (s string)

func NotEq

func NotEq[A any](exp, val A, opts ...cmp.Option) (s string)

func NotEqFunc

func NotEqFunc[A any](exp, val A, eq func(a, b A) bool) (s string)

func NotEqOp

func NotEqOp[C comparable](exp, val C) (s string)

func NotEqual

func NotEqual[E interfaces.EqualFunc[E]](exp, val E) (s string)

func NotNil

func NotNil(a any) (s string)

func Size added in v1.0.7

func Size(n int, size interfaces.SizeFunc) (s string)

func SliceContains

func SliceContains[A any](slice []A, item A, opts ...cmp.Option) (s string)

func SliceContainsEqual

func SliceContainsEqual[E interfaces.EqualFunc[E]](slice []E, item E) (s string)

func SliceContainsFunc

func SliceContainsFunc[A, B any](slice []A, item B, eq func(a A, b B) bool) (s string)

func SliceContainsOp

func SliceContainsOp[C comparable](slice []C, item C) (s string)

func SliceEmpty

func SliceEmpty[A any](slice []A) (s string)

func SliceEqOp

func SliceEqOp[A comparable, S ~[]A](exp, val S) (s string)

func SliceEqual

func SliceEqual[E interfaces.EqualFunc[E]](exp, val []E) (s string)

func SliceLen

func SliceLen[A any](n int, slice []A) (s string)

func SliceNotContains

func SliceNotContains[A any](slice []A, item A, opts ...cmp.Option) (s string)

func SliceNotEmpty

func SliceNotEmpty[A any](slice []A) (s string)

func True

func True(condition bool) string

Asserts `condition` is true, else returns a message.

func Unreachable

func Unreachable() (s string)

func ValidJSON

func ValidJSON(input string) (s string)

func ValidJSONBytes

func ValidJSONBytes(input []byte) (s string)

func Zero

func Zero[N interfaces.Number](value N) (s string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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