Documentation
¶
Index ¶
- func DeepEqual[T any](t testing.TB, expected T, actual T)
- func EmptyMap[K comparable, V any](t testing.TB, m map[K]V)
- func EmptySlice[T any](t testing.TB, s []T)
- func Equal[K comparable](t testing.TB, expected K, actual K)
- func False(t testing.TB, assertion bool)
- func MapContains[K, V comparable](t testing.TB, m map[K]V, k K, v V)
- func MapContainsKey[K comparable, V any](t testing.TB, m map[K]V, k K)
- func MapLength[K comparable, V any](t testing.TB, m map[K]V, expectedLength int)
- func MapNotContains[K, V comparable](t testing.TB, m map[K]V, k K, v V)
- func MapNotContainsKey[K comparable, V any](t testing.TB, m map[K]V, k K)
- func Nil(t testing.TB, actual interface{})
- func NotDeepEqual[T any](t testing.TB, expected T, actual T)
- func NotEmptyMap[K comparable, V any](t testing.TB, m map[K]V)
- func NotEmptySlice[T any](t testing.TB, s []T)
- func NotEqual[K comparable](t testing.TB, expected K, actual K)
- func NotNil(t testing.TB, actual interface{})
- func NotPanic(t testing.TB, underTest func())
- func NotPanicWithError[T any](t testing.TB, expectedError T, underTest func())
- func NotSimilarSlice[T any](t testing.TB, expected []T, actual []T)
- func Panic(t testing.TB, underTest func())
- func PanicWithError[T any](t testing.TB, expectedError T, underTest func())
- func SimilarSlice[T any](t testing.TB, expected []T, actual []T)
- func SliceContains[K comparable](t testing.TB, s []K, element K)
- func SliceLength[T any](t testing.TB, s []T, expectedLength int)
- func SliceNotContains[K comparable](t testing.TB, s []K, element K)
- func True(t testing.TB, assertion bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeepEqual ¶ added in v0.5.0
Asserts that the two given valus are deeply equal. Internally uses reflect.DeepEqual. The equality of arrays, slices and maps can be asserted with this method
func EmptyMap ¶
func EmptyMap[K comparable, V any](t testing.TB, m map[K]V)
Asserts that the given map is empty. The assertion will fail if the given map is nil
func EmptySlice ¶
Asserts that the given slice is empty. The assertion fails if the given slice is nil
func Equal ¶
func Equal[K comparable](t testing.TB, expected K, actual K)
Asserts that the two given values are equal. The given values must be [comparable]
func MapContains ¶
func MapContains[K, V comparable](t testing.TB, m map[K]V, k K, v V)
Asserts that the given map contains the given key-value pair. The key and value must be [comparable]
func MapContainsKey ¶ added in v0.4.0
func MapContainsKey[K comparable, V any](t testing.TB, m map[K]V, k K)
Asserts that the given map contains the given key. The key must be [comparable]
func MapLength ¶
func MapLength[K comparable, V any](t testing.TB, m map[K]V, expectedLength int)
Asserts that the given map has length equal to the specified length
func MapNotContains ¶
func MapNotContains[K, V comparable](t testing.TB, m map[K]V, k K, v V)
Asserts that the given map does not contain the given key-value pair. The key and value must be [comparable]
func MapNotContainsKey ¶ added in v0.4.0
func MapNotContainsKey[K comparable, V any](t testing.TB, m map[K]V, k K)
Asserts that the given map does not contain the given key. The key must be [comparable]
func NotDeepEqual ¶ added in v0.5.0
Asserts that the two given valus are not deeply equal. Internally uses reflect.DeepEqual. The inequality of arrays, slices and maps can be asserted with this method
func NotEmptyMap ¶
func NotEmptyMap[K comparable, V any](t testing.TB, m map[K]V)
Asserts that the given map is not nil or empty
func NotEmptySlice ¶
Asserts that the given slice is not nil or empty
func NotEqual ¶
func NotEqual[K comparable](t testing.TB, expected K, actual K)
Asserts that the two given values are not equal. The given values must be [comparable]
func NotPanicWithError ¶
Asserts that the given function does not panic with the specified error. The assertion succeeds if the given function does not panic or panics with a different error
func NotSimilarSlice ¶
Asserts that the two given slices does not have the same values. The elements must be [comparable]
func PanicWithError ¶
Asserts that the given function panics with the specified error. The actual error must be of the same type and value as the given error
func SimilarSlice ¶
Asserts that the two given slices have the same values in any order. The elements must be [comparable]
func SliceContains ¶
func SliceContains[K comparable](t testing.TB, s []K, element K)
Asserts that the given slice contains the given element. The element must be [comparable]
func SliceLength ¶
Asserts that the given slice has length equal to the specified expected length
func SliceNotContains ¶
func SliceNotContains[K comparable](t testing.TB, s []K, element K)
Asserts that the given slice does not contain the given element. The element must be [comparable]
Types ¶
This section is empty.