Documentation
¶
Index ¶
- func Equal[T any](tb testing.TB, expected, input T)
- func Error(tb testing.TB, input error)
- func ErrorsMatch(tb testing.TB, expected, input error)
- func MapsMatch[K comparable, E any, T ~map[K]E](tb testing.TB, expected, input T)
- func NoError(tb testing.TB, input error)
- func NotPanics(tb testing.TB, fn func())
- func Panics(tb testing.TB, fn func())
- func SlicesMatch[E any, T ~[]E](tb testing.TB, expected, input T)
- func Within[T cmp.Ordered](tb testing.TB, minT, maxT, input T)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorsMatch ¶
ErrorsMatch asserts that the input and expected error either are both nil or both have the same string returned by Error. This is to facilitate table driven test with a single expected error field.
func MapsMatch ¶
func MapsMatch[K comparable, E any, T ~map[K]E](tb testing.TB, expected, input T)
MapsMatch asserts that both expected and input have the same members regardless of order elements in expected and input are compared using reflect.DeepEqual. Failing results will only print the non-matching elements
func SlicesMatch ¶
SlicesMatch asserts that both expected and input have the same members regardless of order elements in expected and input are compared using reflect.DeepEqual. Failing results will only print the non-matching elements
Types ¶
This section is empty.