MCPcopy
hub / github.com/cweill/gotests / TestFunction

Method TestFunction

internal/render/render.go:96–125  ·  view source on GitHub ↗

TestFunction renders a test function for the given function signature with the specified options.

(
	w io.Writer,
	f *models.Function,
	printInputs bool,
	subtests bool,
	named bool,
	parallel bool,
	useGoCmp bool,
	params map[string]interface{},
	aiCases []interface{})

Source from the content-addressed store, hash-verified

94
95// TestFunction renders a test function for the given function signature with the specified options.
96func (r *Render) TestFunction(
97 w io.Writer,
98 f *models.Function,
99 printInputs bool,
100 subtests bool,
101 named bool,
102 parallel bool,
103 useGoCmp bool,
104 params map[string]interface{},
105 aiCases []interface{}) error {
106 return r.tmpls.ExecuteTemplate(w, "function", struct {
107 *models.Function
108 PrintInputs bool
109 Subtests bool
110 Parallel bool
111 Named bool
112 UseGoCmp bool
113 TemplateParams map[string]interface{}
114 AIGeneratedCases []interface{}
115 }{
116 Function: f,
117 PrintInputs: printInputs,
118 Subtests: subtests,
119 Parallel: parallel,
120 Named: named,
121 UseGoCmp: useGoCmp,
122 TemplateParams: params,
123 AIGeneratedCases: aiCases,
124 })
125}

Calls

no outgoing calls