Documentation ¶
Index ¶
- func AssertApproxDuration(t *testing.T, tolerance time.Duration, v1, v2 time.Duration, format string, ...)
- func AssertApproxTime(t *testing.T, tolerance time.Duration, v1, v2 time.Time, format string, ...)
- func AssertContains(t *testing.T, str string, substrs ...string)
- func AssertEqual(t *testing.T, got interface{}, expected interface{}, msg ...interface{})
- func AssertErrContains(t *testing.T, err error, substrs ...string)
- func AssertFalse(t *testing.T, b bool, msg ...interface{})
- func AssertNoErr(t *testing.T, err error)
- func AssertNotEqual(t *testing.T, got interface{}, expected interface{}, msg ...interface{})
- func AssertTrue(t *testing.T, b bool, msg ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertApproxDuration ¶
func AssertApproxDuration(t *testing.T, tolerance time.Duration, v1, v2 time.Duration, format string, args ...interface{})
AssertApproxDuration checks if the durations v1 and v2 are close up to the tolerance specified. The format and args slice can be used for generating an appropriate error message if they are not.
func AssertApproxTime ¶
func AssertApproxTime(t *testing.T, tolerance time.Duration, v1, v2 time.Time, format string, args ...interface{})
AssertApproxTime checks if the times v1 and v2 are close up to the tolerance specified. The format and args slice can be used for generating an appropriate error message if they are not.
func AssertContains ¶
AssertContains will check if an input string contains all the input substrings
func AssertEqual ¶
AssertEqual will compare the got argument with the expected argument and fail the test with an appropriate error message if they don't match.
func AssertErrContains ¶
AssertErrContains will first check if the error that the error indeed is not nil, and then check if its error message contains all the substrs specified on the substrs argument.
In case either assertion fails it will fail the test with an appropriate error message.
func AssertFalse ¶
AssertFalse will check if the input argument is false
func AssertNoErr ¶
AssertNoErr will check if the input error is nil, and if not it will fail the test with an appropriate error message.
func AssertNotEqual ¶
AssertNotEqual will compare the got argument with the expected argument and fail the test with an appropriate error message if they match.
func AssertTrue ¶
AssertTrue will check if the input argument is true
Types ¶
This section is empty.