Documentation ¶
Overview ¶
Package gen provides a generator for creating assignment statements for input parameters of functions for every function found in a given folder
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct { PackageName string FileName string // funcName, list of test cases TestCases map[string][]*testcase.TestCase PackageInfo *importer.PackageInfo IdentGen ident.IGen Opts *Options Deco *decorator.Deco }
File file contains test cases for functions of a given file
func NewFile ¶
func NewFile(pathName string, pkgInfo *importer.PackageInfo, opts *Options, deco *decorator.Deco) *File
NewFile creates a new file object
func (*File) GetTestCasesForFunctionsInFile ¶
func (f *File) GetTestCasesForFunctionsInFile(path string, astFile *ast.File) map[string][]*testcase.TestCase
GetTestCasesForFunctionsInFile convert given input ast file to a set of test cases per function test case contains a set of decl and assignment statement to generate test cases
func (*File) TestCasePrefix ¶
TestCasePrefix in case of receiver create prefix this is need to ensure test results dont override eachother in case of: func X() func (r T) X()
type Generator ¶
type Generator struct { Dir string PackageInfo *importer.PackageInfo Opts *Options Deco *decorator.Deco }
Generator the generator
func (*Generator) GetNewOrganism ¶
GetNewOrganism get a single organism
func (*Generator) GetTestCases ¶
GetTestCases retrieve test cases, start of recursions
type Organism ¶
Organism organism is a set of testcases for functions of files in a given directory
func (*Organism) UpdateAssertStmts ¶
UpdateAssertStmts sets an os assert statements based on printed runtime result