MCPcopy Create free account
hub / github.com/temporalio/temporal / isTestFunc

Function isTestFunc

tools/parallelize/parallelize.go:120–131  ·  view source on GitHub ↗

isTestFunc returns true for func TestXxx(t *testing.T).

(fn *ast.FuncDecl)

Source from the content-addressed store, hash-verified

118
119// isTestFunc returns true for func TestXxx(t *testing.T).
120func isTestFunc(fn *ast.FuncDecl) bool {
121 if fn.Recv != nil {
122 return false // method, not a function
123 }
124 if !strings.HasPrefix(fn.Name.Name, "Test") {
125 return false
126 }
127 if fn.Body == nil {
128 return false
129 }
130 return testingTParamName(fn) != ""
131}
132
133// testingTParamName returns the name of the *testing.T parameter, or "" if not found.
134func testingTParamName(fn *ast.FuncDecl) string {

Callers 1

processFileFunction · 0.85

Calls 1

testingTParamNameFunction · 0.85

Tested by

no test coverage detected