Documentation
¶
Overview ¶
Package testassert provides shared assertion helpers for tests.
New code should import this package instead of the legacy testutils path:
import "github.com/InsideGallery/core/testassert" testassert.Equal(t, got, want)
Compatibility: github.com/InsideGallery/core/testutils remains available for existing tests. Prefer testassert in new tests so assertions have a focused package name and do not extend the legacy utility aggregate.
Index ¶
- func ApproximatelyEqual(a, b float64) bool
- func Equal(t testing.TB, received, expected interface{})
- func EqualError(received, expected error) bool
- func EqualJSON(t testing.TB, received, expected []byte)
- func IsEqual(received, expected interface{}) bool
- func NotEqual(t testing.TB, received, expected interface{})
- func NotEqualJSON(t testing.TB, received, expected []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApproximatelyEqual ¶
ApproximatelyEqual reports whether two floats are nearly equal.
func EqualError ¶
EqualError reports whether two errors are equivalent.
func IsEqual ¶
func IsEqual(received, expected interface{}) bool
IsEqual reports whether two values are equivalent.
func NotEqualJSON ¶
NotEqualJSON fails the test when two JSON values are equivalent.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.