Documentation
¶
Overview ¶
Package assert provides a set of tools for use with the Go testing package.
Index ¶
- func Compare[T any](t *testing.T, actual, expected T, opts ...cmp.Option)
- func Contains(t *testing.T, actual, expected string)
- func Equal[T comparable](t *testing.T, actual, expected T)
- func Error(t *testing.T, err error, expected string)
- func False(t *testing.T, value bool)
- func IsError(t *testing.T, actual, expected error)
- func MockExpectationsMet(t *testing.T, mock sqlmock.Sqlmock)
- func Nil(t *testing.T, object any)
- func NotEqual[T comparable](t *testing.T, actual, expected T)
- func NotNil(t *testing.T, object any)
- func True(t *testing.T, value bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compare ¶
Compare asserts that the expected value is equal to the actual value. Actual and expected need not be comparable.
func Equal ¶
func Equal[T comparable](t *testing.T, actual, expected T)
Equal asserts that the expected value is equal to the actual value. Actual and expected must be comparable. To compare non-comparable types use Compare.
func MockExpectationsMet ¶
MockExpectationsMet asserts that the expectations for the given mock were met.
func NotEqual ¶
func NotEqual[T comparable](t *testing.T, actual, expected T)
NotEqual asserts that the expected value is not equal to the actual value. Actual and expected must be comparable. To compare non-comparable types use Compare.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.