Documentation
¶
Index ¶
- func FormatGoFunc(path []string, rootVar string) string
- func GenerateTestFile[Q any, R any, TestingContext ITestingAware](tt *Case[Q, R, TestingContext], caseName string, file string, pkg string) error
- func GenerateTestFileCode[Q any, R any, TestingContext ITestingAware](tt *Case[Q, R, TestingContext], caseName string, pkg string) string
- func JoinAsFuncName(names []string) string
- type Case
- func (c *Case[Q, R, TestingContext]) FindPath(path []string) (CasePath[Q, R, TestingContext], error)
- func (c *Case[Q, R, TestingContext]) FindSubCase(name string) *Case[Q, R, TestingContext]
- func (c *Case[Q, R, TestingContext]) GetAllCases() []CasePath[Q, R, TestingContext]
- func (c *Case[Q, R, TestingContext]) RunAll(t *testing.T)
- func (c *Case[Q, R, TestingContext]) RunPath(t *testing.T, path []string)
- 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] struct { Name string Run func(tctx *TestingContext, req *Q) (*R, error) Setup func(tctx *TestingContext, req *Q) (*TestingContext, *Q) Assert func(t *testing.T, tctx *TestingContext, req *Q, res *R, err error) SubCases []*Case[Q, R, TestingContext] }
func (*Case[Q, R, TestingContext]) FindSubCase ¶
func (*Case[Q, R, TestingContext]) GetAllCases ¶
type CasePath ¶
type ITestingAware ¶ added in v0.0.2
Click to show internal directories.
Click to hide internal directories.