Documentation
¶
Index ¶
- func Contains(t *testing.T, container any, item any, message ...any)deprecated
- func DeepEqual(t *testing.T, want, have any, message ...any)
- func Equal[T comparable](t *testing.T, want, have T, message ...any)
- func ErrorIs(t *testing.T, want, have error, message ...any)
- func ErrorIsNot(t *testing.T, want, have error, message ...any)
- func ErrorNotType[T error](t *testing.T, have error, message ...any)
- func ErrorType[T error](t *testing.T, have error, message ...any)
- func False(t *testing.T, result bool, message ...any)
- func Greater[T internal.Number](t *testing.T, want T, have any, message ...any)deprecated
- func GreaterOrEqual[T internal.Number](t *testing.T, want T, have any, message ...any)
- func GreaterThan[T internal.Number](t *testing.T, want T, have any, message ...any)
- func InDelta(t *testing.T, want, have, delta float64, message ...any)
- func Inside(t *testing.T, item, container any, message ...any)
- func Len[T internal.Number](t *testing.T, want T, have any, message ...any)deprecated
- func Less[T internal.Number](t *testing.T, want T, have any, message ...any)deprecated
- func LessOrEqual[T internal.Number](t *testing.T, want T, have any, message ...any)
- func LessThan[T internal.Number](t *testing.T, want T, have any, message ...any)
- func Nil(t *testing.T, item any, message ...any)
- func NotContains(t *testing.T, container any, item any, message ...any)deprecated
- func NotEqual[T comparable](t *testing.T, want, have T, message ...any)
- func NotInside(t *testing.T, item, container any, message ...any)
- func NotNil(t *testing.T, item any, message ...any)
- func NotPanic(t *testing.T, fn func(), message ...any)
- func Panic(t *testing.T, fn func(), message ...any)
- func PanicWithMessage(t *testing.T, expected string, fn func(), message ...any)
- func Size[T internal.Number](t *testing.T, want T, have any, message ...any)
- func True(t *testing.T, result bool, message ...any)
- func WillClose(t *testing.T, ch <-chan struct{}, timeout time.Duration, message ...any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeepEqual ¶
DeepEqual fails the test if want and have are not deeply equal. It uses reflect.DeepEqual to compare complex structures, slices, and maps.
func Equal ¶
func Equal[T comparable](t *testing.T, want, have T, message ...any)
Equal fails the test if want and have are not equal.
func ErrorIs ¶ added in v0.5.0
ErrorIs fails the test if the provided error does not match the expected type, even when wrapped.
func ErrorIsNot ¶ added in v0.5.0
ErrorIsNot fails the test if the provided error matches the specified type, even when wrapped.
func ErrorNotType ¶ added in v0.5.0
ErrorNotType fails the test if the provided error is of the specified type.
func ErrorType ¶ added in v0.5.0
ErrorType fails the test if the provided error is not of the expected type.
func GreaterOrEqual ¶
GreaterOrEqual fails the test if have is not greater than or equal to want.
func GreaterThan ¶ added in v0.4.0
GreaterThan fails the test if have is not greater than want.
func InDelta ¶
InDelta fails the test if the absolute difference between want and have is greater than the specified delta.
func Inside ¶ added in v0.4.0
Inside fails the test if the container (string, slice, or array) does not include the item.
func LessOrEqual ¶
LessOrEqual fails the test if have is not less than or equal to want.
func NotEqual ¶
func NotEqual[T comparable](t *testing.T, want, have T, message ...any)
NotEqual fails the test if want and have are equal.
func PanicWithMessage ¶
PanicWithMessage fails the test if the function does not panic or if the panic message differs.
func Size ¶ added in v0.4.0
Size fails the test if the length of 'have' does not match 'want'. It supports Slice, Map, Array, Chan, and String.
Types ¶
This section is empty.