Documentation
¶
Index ¶
- func GetFunctionBodyText(text string, functionName string) (bool, string)
- func RemoveAllComments(text string) string
- func RunFunctionAnatomyTests(testFuncs []FuncAnatomyTest, t *testing.T)
- func RunFunctionOutputTests(testFuncs []FuncOutputTest, randomSeed int64, t *testing.T)
- func RunInstantiateObjectsTest(text string, objectName string, minObjectCount int, maxObjectCount int, ...)
- func RunInstantiateObjectsTestWithFunctionName(text string, objectName string, minObjectCount int, maxObjectCount int, ...)
- func RunMethodAnatomyTest(testObject interface{}, methodTest MethodAnatomyTest, t *testing.T) bool
- func RunMethodAnatomyTests(testObject interface{}, methodTests []MethodAnatomyTest, t *testing.T)
- func RunMethodOutputTest(testObject interface{}, methodTest MethodOutputTest, randomSeed int64, ...) reflect.Value
- func RunMethodOutputTests(testObject interface{}, methodTests []MethodOutputTest, randomSeed int64, ...)
- func RunRandomNumberTemplateTest(text string, t *testing.T)
- func RunValidateFlagArgTest(text string, flagType FlagType, flagName string, t *testing.T)
- func StandardRunTimeErrorCheck(t *testing.T)
- type FlagType
- type FuncAnatomyTest
- type FuncOutputTest
- type MethodAnatomyTest
- type MethodOutputTest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFunctionBodyText ¶
Returns the specified function body text. First return value = true if function was found, otherwise false Second return value = function body text
func RemoveAllComments ¶
Removes all comments from the specified text and returns filtered text
func RunFunctionAnatomyTests ¶
func RunFunctionAnatomyTests(testFuncs []FuncAnatomyTest, t *testing.T)
Runs standard function anatomy tests
func RunFunctionOutputTests ¶
func RunFunctionOutputTests(testFuncs []FuncOutputTest, randomSeed int64, t *testing.T)
Runs standard function output tests using provided values
func RunInstantiateObjectsTest ¶
func RunInstantiateObjectsTest(text string, objectName string, minObjectCount int, maxObjectCount int, t *testing.T)
Tests specified code text to make sure the correct number of the specified objects are instantiated in the code
func RunInstantiateObjectsTestWithFunctionName ¶
func RunInstantiateObjectsTestWithFunctionName(text string, objectName string, minObjectCount int, maxObjectCount int, objInstantiatedFuncName string, t *testing.T)
Tests specified code text to make sure the correct number of the specified objects are instantiated in the code.
func RunMethodAnatomyTest ¶
func RunMethodAnatomyTest(testObject interface{}, methodTest MethodAnatomyTest, t *testing.T) bool
Runs standard struct method anatomy test using provided values. Returns true if anatomy passes tests. Otherwise returns false. IMPORTANT: testObject must be a pointer to the struct object being tested!
func RunMethodAnatomyTests ¶
func RunMethodAnatomyTests(testObject interface{}, methodTests []MethodAnatomyTest, t *testing.T)
Runs standard struct method anatomy tests using provided values IMPORTANT: testObject must be a pointer to the struct object being tested!
func RunMethodOutputTest ¶
func RunMethodOutputTest(testObject interface{}, methodTest MethodOutputTest, randomSeed int64, t *testing.T) reflect.Value
Runs standard struct method output test. Returns provided object after method has been invoked for further evaluation. IMPORTANT: testObject must be a pointer to the struct object being tested!
func RunMethodOutputTests ¶
func RunMethodOutputTests(testObject interface{}, methodTests []MethodOutputTest, randomSeed int64, t *testing.T)
Runs standard struct method output tests using provided values IMPORTANT: testObject must be a pointer to the struct object being tested!
func RunRandomNumberTemplateTest ¶
Tests specified code text to confirm using proper random number seeding template
func RunValidateFlagArgTest ¶
Tests specified code text to make sure specified command line flags are mapped to a variable of the appropriate type
func StandardRunTimeErrorCheck ¶
This function is meant to be used by all unit tests in order to gracefully recover from runtime errors and provide a standard error message
Types ¶
type FuncAnatomyTest ¶
type FuncAnatomyTest struct { Name string Obj interface{} ArgTypes []reflect.Type ReturnTypes []reflect.Type }
Function anatomy testing struct
type FuncOutputTest ¶
type FuncOutputTest struct { Name string Obj interface{} Args []reflect.Value StdinStrings []string IgnoreStdout bool StdoutStrings []string IgnoreReturns bool Returns []reflect.Value }
Function output testing struct
type MethodAnatomyTest ¶
Method anatomy testing struct