Documentation
¶
Overview ¶
A wrapper around *testing.T. I hate the if a != b { t.ErrorF(....) } pattern. Packages should prefer using the tests package (which exposes all of these functions). The only reason to use this package directly is if the tests package depends on your package (and thus you have a cyclical dependency)
Index ¶
- func DoesNotContain[T comparable](t *testing.T, haystack []T, needle T)
- func Equal[T comparable](t *testing.T, actual T, expected T)
- func Error(t *testing.T, actual error, expected error)
- func False(t *testing.T, actual bool)
- func List[T comparable](t *testing.T, actuals []T, expecteds []T)
- func Nil(t *testing.T, actual interface{})
- func NotNil(t *testing.T, actual interface{})
- func Nowish(t *testing.T, actual time.Time)
- func StringContains(t *testing.T, actual string, expected string)
- func True(t *testing.T, actual bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoesNotContain ¶
func DoesNotContain[T comparable](t *testing.T, haystack []T, needle T)
needle not in []haystack
func List ¶
func List[T comparable](t *testing.T, actuals []T, expecteds []T)
Two lists are equal (same length & same values in the same order)
func StringContains ¶
The string contains the given value
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.