Documentation ¶
Index ¶
- func Run(_ string, f func(*T))
- type ErrFailNow
- type T
- func (m *T) CheckFailed(t *testing.T, fatal bool)
- func (m *T) CheckSucceeded(t *testing.T)
- func (m *T) Errorf(format string, args ...interface{})
- func (m *T) Fail()
- func (m *T) FailNow()
- func (m *T) Fatalf(format string, args ...interface{})
- func (m *T) Helper()
- func (m *T) Logf(format string, args ...interface{})
- func (m *T) Reset()
- func (m *T) Text() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrFailNow ¶
type ErrFailNow struct{}
ErrFailNow is the type used in panics to abort a test when users call FailNow.
type T ¶
type T struct {
// contains filtered or unexported fields
}
T is a type passed to Test functions to manage test state and support formatted test logs. A minimal mock of testing.T.
func (*T) CheckFailed ¶
CheckFailed verifies that a mock test failed, otherwise it logs the test failure.
func (*T) CheckSucceeded ¶
CheckSucceeded verifies that a mock test succeeded, otherwise it logs the failure.
func (*T) Fail ¶
func (m *T) Fail()
Fail marks the function as having failed but continues execution.
func (*T) FailNow ¶
func (m *T) FailNow()
FailNow marks the function as having failed.
Depending on the mode, it may either terminate further tests by panicking or it may not. To get termination, use the function Run. Otherwise, fatal errors are simply recorded.
func (*T) Helper ¶
func (m *T) Helper()
Helper marks the calling function as a test helper function. This is a no-op for the mock.
func (*T) Logf ¶
Logf formats its arguments according to the format, analogous to Printf, and records the text in the error log.