Documentation
¶
Index ¶
- func Contains(t *testing.T, sub, full string)
- func Equals[T comparable](t *testing.T, expected, actual T)
- func Err(t *testing.T, expected, actual error)
- func False(t *testing.T, value bool)
- func MapEquals[M1, M2 ~map[K]V, K, V comparable](t *testing.T, expected M1, actual M2)
- func Nil(t *testing.T, value any)
- func NotEqual[T comparable](t *testing.T, expected, actual T)
- func NotNil(t *testing.T, value any)
- func Panic(t *testing.T, f func())
- func RunFromDir(t *testing.T, relativeDirChange string)
- func SliceEquals[T comparable](t *testing.T, expected, actual []T)
- func True(t *testing.T, value bool)
- type CountWriter
- type ErrWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Equals ¶
func Equals[T comparable](t *testing.T, expected, actual T)
Equals compares two values, in some rare cases due to generic limitations you may have to use `reflect.DeepEquals` instead.
func MapEquals ¶
func MapEquals[M1, M2 ~map[K]V, K, V comparable](t *testing.T, expected M1, actual M2)
MapEquals compares two map values for same length and same key+value pairs.
func NotEqual ¶
func NotEqual[T comparable](t *testing.T, expected, actual T)
NotEquals compares two values are not equal
func RunFromDir ¶ added in v0.1.0
RunFromDir will change our directory temporarily for a test
func SliceEquals ¶
func SliceEquals[T comparable](t *testing.T, expected, actual []T)
SliceEquals compares two slices for same length and same values at each index.
Types ¶
type CountWriter ¶
type CountWriter struct {
// contains filtered or unexported fields
}
CountWriter is a simple struct that will successfully write to a byte buffer a specified number of times, and then it will error
func NewCountWriter ¶
func NewCountWriter(count int) *CountWriter
type ErrWriter ¶
type ErrWriter struct {
// contains filtered or unexported fields
}
ErrWriter is a simple struct that will return an error when trying to Write
func NewErrWriter ¶
func NewErrWriter() *ErrWriter
Click to show internal directories.
Click to hide internal directories.