Documentation ¶
Index ¶
- func AboutEqual[T constraints.Integer | constraints.Float](t Tester, expected, actual T, delta T)
- func Different[T comparable](t Tester, expected, actual T)
- func Equal[T comparable](t Tester, expected, actual T)
- func Error(t Tester, err error)
- func ErrorContains(t Tester, err error, contains string)
- func ErrorMatches(t Tester, err error, pattern string)
- func Failed(t Tester, count int) bool
- func Failf(t Tester, format string, args ...interface{})
- func False(t Tester, condition bool)
- func IsError(t Tester, expected, actual error)
- func Logf(t Tester, format string, args ...interface{})
- func MkPosNeg(t *testing.T) (Tester, Tester)
- func Nil(t Tester, value any)
- func NoError(t Tester, err error)
- func NotNil(t Tester, value any)
- func Range[T constraints.Integer | constraints.Float](t Tester, value, lower, upper T)
- func True(t Tester, condition bool)
- type Tester
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AboutEqual ¶
func AboutEqual[T constraints.Integer | constraints.Float](t Tester, expected, actual T, delta T)
AboutEqual checks if the given values are equal within a delta.
func Different ¶
func Different[T comparable](t Tester, expected, actual T)
Different checks if the given values are different. It uses the != operator for comparable types and is the opposite of Equal.
func Equal ¶
func Equal[T comparable](t Tester, expected, actual T)
Equal checks if the given values are equal. It uses the == operator for comparable types.
func ErrorContains ¶
ErrorContains checks if the given error is not nil and its message contains the expected substring.
func ErrorMatches ¶
ErrorMatches checks if the given error is not nil and its message matches the expected regular expression.
func IsError ¶
IsError checks if the given error is not nil and of the expected type. It uses the errors.Is() function.
func Logf ¶
It's used to print additional information during testing. The location and function name are added automatically.
func Range ¶
func Range[T constraints.Integer | constraints.Float](t Tester, value, lower, upper T)
Range checks if the given value is within lower and upper bounds.