Documentation
¶
Index ¶
- func Run[T testingSuite](t *testing.T, s T, args ...any)
- type Suite
- func (b *Suite) Assert() *assert.Assertionsdeprecated
- func (b *Suite) Require() *require.Assertionsdeprecated
- func (s *Suite[T]) Run(name string, fn func(T)) bool
- func (b *Suite) SetS(_ testifysuite.TestingSuite)deprecated
- func (b *Suite) SetT(_ *testing.T)deprecated
- func (s *Suite[T]) T() *testing.T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
Run discovers and runs all exported Test* methods on the given suite in parallel.
Each method gets its own fresh suite instance initialized for the subtest's *testing.T. Both the suite-level test and each method subtest are marked as parallel. Any sequential setup must happen before calling Run.
The suite must embed Suite and have no other fields.
Types ¶
type Suite ¶
type Suite[T testingSuite] struct {
*require.Assertions
protorequire.ProtoAssertions
historyrequire.HistoryRequire
// contains filtered or unexported fields
}
Suite provides parallel test execution with require-style (fail-fast) assertions.
It enforces a strict rule: a test method (or subtest) must either use assertions directly OR create subtests via Run — not both.
func (*Suite) Assert
deprecated
func (b *Suite) Assert() *assert.Assertions
Deprecated: Assert returns non-fatal assertions which are not supported. Use s.NoError, s.Equal, etc. directly (require semantics).
func (*Suite) Require
deprecated
func (b *Suite) Require() *require.Assertions
Deprecated: Require bypasses the guard mechanism. Use s.NoError, s.Equal, etc. directly.
func (*Suite[T]) Run ¶
Run creates a parallel subtest. The callback receives a fresh copy of the concrete suite type, initialized for the subtest's *testing.T.
func (*Suite) SetS
deprecated
func (b *Suite) SetS(_ testifysuite.TestingSuite)
Deprecated: SetS is managed internally by Run. Do not call directly.