Documentation
¶
Index ¶
- func FormatGoFunc(path []string, rootVar string) string
- func GenerateTestFile[Q any, R any, TestingContext ITestingAware, V any](tt *Case[Q, R, TestingContext, V], caseName string, file string, pkg string) error
- func GenerateTestFileCode[Q any, R any, TestingContext ITestingAware, V any](tt *Case[Q, R, TestingContext, V], caseName string, pkg string) string
- func JoinAsFuncName(names []string) string
- type Case
- func (c *Case[Q, R, TestingContext, V]) FindPath(path []string) (CasePath[Q, R, TestingContext, V], error)
- func (c *Case[Q, R, TestingContext, V]) FindSubCase(name string) *Case[Q, R, TestingContext, V]
- func (c *Case[Q, R, TestingContext, V]) GetAllCases() []CasePath[Q, R, TestingContext, V]
- func (c *Case[Q, R, TestingContext, V]) RunAll(t *testing.T)
- func (c *Case[Q, R, TestingContext, V]) RunPath(t *testing.T, path []string)
- func (c *Case[Q, R, TestingContext, V]) RunPathVariant(t *testing.T, path []string, v V)
- type CasePath
- type ITestingAware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatGoFunc ¶
func GenerateTestFile ¶
func GenerateTestFileCode ¶
func JoinAsFuncName ¶
Types ¶
type Case ¶
type Case[Q any, R any, TestingContext any, V any] struct { Name string Variants []V Run func(tctx *TestingContext, req *Q, variant V) (*R, error) Setup func(tctx *TestingContext, req *Q, variant V) (*TestingContext, *Q) Assert func(t *testing.T, tctx *TestingContext, req *Q, variant V, res *R, err error) SubCases []*Case[Q, R, TestingContext, V] }
func (*Case[Q, R, TestingContext, V]) FindSubCase ¶
func (*Case[Q, R, TestingContext, V]) GetAllCases ¶
type CasePath ¶
func (CasePath[Q, R, TestingContext, V]) GetVariants ¶
func (c CasePath[Q, R, TestingContext, V]) GetVariants() []V
type ITestingAware ¶
Click to show internal directories.
Click to hide internal directories.