Documentation
¶
Index ¶
- type Record
- type TB
- func (tb *TB) Cleanup(f func())
- func (tb *TB) Error(args ...any)
- func (tb *TB) Errorf(format string, args ...any)
- func (tb *TB) Fail()
- func (tb *TB) FailNow()
- func (tb *TB) Failed() bool
- func (tb *TB) Fatal(args ...any)
- func (tb *TB) Fatalf(format string, args ...any)
- func (tb *TB) Helper()
- func (tb *TB) Log(args ...any)
- func (tb *TB) Logf(format string, args ...any)
- func (tb *TB) Name() string
- func (tb *TB) Setenv(key, value string)
- func (tb *TB) Skip(args ...any)
- func (tb *TB) SkipNow()
- func (tb *TB) Skipf(format string, args ...any)
- func (tb *TB) Skipped() bool
- func (tb *TB) TempDir() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Record ¶
Record records the result of Run.
func Run ¶
Run runs the given mocking test function with testing.TB. The f can be described in the same way as the test function of the go test. Run call the f on new goroutine. The return value records whether the test function failed (e.g. t.Error), was skipped (e.g. t.Skip), failed and exited its goroutine (e.g. t.Fatal) or panic occured.
type TB ¶
type TB struct { // mock funcs CleanupFunc func(func()) ErrorFunc func(args ...any) ErrorfFunc func(format string, args ...any) FailFunc func() FailNowFunc func() FailedFunc func() bool FatalFunc func(args ...any) FatalfFunc func(format string, args ...any) HelperFunc func() LogFunc func(args ...any) LogfFunc func(format string, args ...any) NameFunc func() string SetenvFunc func(key, value string) SkipFunc func(args ...any) SkipNowFunc func() SkipfFunc func(format string, args ...any) SkippedFunc func() bool TempDirFunc func() string testing.TB // for default behavior andd private method // contains filtered or unexported fields }
TB is mock for testing.TB. XxxFunc is a mock function for the method Xxx of testing.TB. If you confirm more usage please see Run.
Click to show internal directories.
Click to hide internal directories.