Documentation
¶
Index ¶
- func ElementsMatch[T any](t *testing.T, arrA, arrB []T)
- func Equal(t *testing.T, expected interface{}, actual interface{}, prefixes ...string)
- func Error(t *testing.T, err error)
- func ErrorIs(t *testing.T, err error, target error)
- func ErrorType(t *testing.T, err error, target error)
- func ErrorWith(t *testing.T, err error, content string)
- func MapHas[K comparable, V any](t *testing.T, m map[K]V, key K, val V)
- func MapMatch[K comparable, V any](t *testing.T, mapA, mapB map[K]V)
- func NilError(t *testing.T, err error)
- func NotEqual(t *testing.T, expected interface{}, actual interface{}, prefixes ...string)
- func NotNil(t *testing.T, val interface{})
- type Counter
- type ErrorFunc
- type ResultErrorFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ElementsMatch ¶
ElementsMatch asserts both slices have the same amount and equal elements. Any extra items will be listed in error log.
func ErrorWith ¶
ErrorWith asserts err does contain target content within error string representation.
func MapMatch ¶
func MapMatch[K comparable, V any](t *testing.T, mapA, mapB map[K]V)
MapMatch asserts all keys and corresponding values are applied to both map.
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
func Count ¶
Count returns a Counter with expected n count to be asserted. Use Inc() to mark a call. Assert() will be called on test cleanup, so it's not necessary to call it manually but recommended due to convention to not hide any test side effects.
Click to show internal directories.
Click to hide internal directories.