Documentation
¶
Index ¶
- type B
- type BenchFunc
- type Middleware
- type RunFunc
- type Runner
- type T
- type TestFunc
- type W
- func (w *W[T]) BaseName() string
- func (w *W[T]) Cleanup(f func())
- func (w *W[T]) Context() context.Context
- func (w *W[T]) Error(args ...any)
- func (w *W[T]) Errorf(format string, args ...any)
- func (w *W[T]) Fail()
- func (w *W[T]) FailNow()
- func (w *W[T]) Failed() bool
- func (w *W[T]) Fatal(args ...any)
- func (w *W[T]) Fatalf(format string, args ...any)
- func (w *W[T]) Helper()
- func (w *W[T]) Log(args ...any)
- func (w *W[T]) Logf(format string, args ...any)
- func (w *W[T]) Name() string
- func (w *W[T]) Run(name string, fn RunFunc[T]) bool
- func (w *W[T]) RunSuite(s any)
- func (w *W[T]) Skip(args ...any)
- func (w *W[T]) SkipNow()
- func (w *W[T]) Skipf(format string, args ...any)
- func (w *W[T]) Skipped() bool
- func (w *W[T]) TempDir() string
- func (w *W[T]) Unwrap() T
- func (w *W[T]) Use(m ...Middleware[T]) *W[T]
- func (w *W[T]) WithContext(ctx context.Context) *W[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Middleware ¶
Middleware represents a function that can wrap a test function
func WithParallel ¶
func WithParallel() Middleware[*testing.T]
WithParallel creates middleware that runs tests in parallel
func WithTimeout ¶
func WithTimeout[T Runner[T]](d time.Duration) Middleware[T]
WithTimeout creates middleware that adds a timeout to the test context
type W ¶
type W[T Runner[T]] struct { // contains filtered or unexported fields }
W is a context-aware wrapper for test/benchmark types
func (*W[T]) Cleanup ¶
func (w *W[T]) Cleanup(f func())
Cleanup registers a function to be called when the test completes
func (*W[T]) Use ¶
func (w *W[T]) Use(m ...Middleware[T]) *W[T]
Use adds middleware to the test helper
Click to show internal directories.
Click to hide internal directories.