Documentation
¶
Index ¶
- func Contains[T comparable](t testing.TB, s []T, v ...T)
- func ContainsKeys[T comparable, A any](t testing.TB, m map[T]A, keys ...T)
- func ContainsVals[A, T comparable](t testing.TB, m map[A]T, vals ...T)
- func Equal[T comparable](t testing.TB, result, expected T)
- func EqualC[T any](t testing.TB, result Comparable[T], expected T)
- func EqualMaps[K, V comparable](t testing.TB, result, expected map[K]V)
- func EqualSlices[T comparable, TS ~[]T](t testing.TB, result, expected TS)
- func Error(t testing.TB, err error)
- func ErrorAs(t testing.TB, err error, target any)
- func ErrorIs(t testing.TB, err, target error)
- func NilError(t testing.TB, err error)
- type Comparable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[T comparable](t testing.TB, s []T, v ...T)
Contains calls t.Fatalf if any value v is not present in s.
func ContainsKeys ¶
func ContainsKeys[T comparable, A any](t testing.TB, m map[T]A, keys ...T)
ContainsKeys calls t.Fatalf if any of the specified keys are not present in m.
func ContainsVals ¶
func ContainsVals[A, T comparable](t testing.TB, m map[A]T, vals ...T)
ContainsVals calls t.Fatalf if any of the specified vals are not present in m.
func Equal ¶
func Equal[T comparable](t testing.TB, result, expected T)
Equal calls t.Fatalf if result != expected.
func EqualC ¶
func EqualC[T any](t testing.TB, result Comparable[T], expected T)
EqualC calls t.Fatalf if result != expected.
func EqualMaps ¶
func EqualMaps[K, V comparable](t testing.TB, result, expected map[K]V)
EqualMaps calls t.Fatalf if result expected do not contain the same elements.
func EqualSlices ¶
func EqualSlices[T comparable, TS ~[]T](t testing.TB, result, expected TS)
EqualSlices calls t.Fatalf if result expected do not contain the same elements in the same order.
Types ¶
type Comparable ¶
type Comparable[T any] interface { // Equal should return true if t is equal to the receiver. Equal(t T) bool }
A Comparable can be compared to other instances of the same type.
Click to show internal directories.
Click to hide internal directories.