MCPcopy Create free account
hub / github.com/github/gh-aw / TestBuildWorkflowDescription

Function TestBuildWorkflowDescription

pkg/cli/run_interactive_test.go:151–195  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

149}
150
151func TestBuildWorkflowDescription(t *testing.T) {
152 tests := []struct {
153 name string
154 inputs map[string]*workflow.InputDefinition
155 expected string
156 }{
157 {
158 name: "no inputs",
159 inputs: nil,
160 expected: "",
161 },
162 {
163 name: "only required inputs",
164 inputs: map[string]*workflow.InputDefinition{
165 "input1": {Required: true},
166 "input2": {Required: true},
167 },
168 expected: "",
169 },
170 {
171 name: "only optional inputs",
172 inputs: map[string]*workflow.InputDefinition{
173 "input1": {Required: false},
174 "input2": {Required: false},
175 },
176 expected: "",
177 },
178 {
179 name: "mixed inputs",
180 inputs: map[string]*workflow.InputDefinition{
181 "input1": {Required: true},
182 "input2": {Required: false},
183 "input3": {Required: true},
184 },
185 expected: "",
186 },
187 }
188
189 for _, tt := range tests {
190 t.Run(tt.name, func(t *testing.T) {
191 result := buildWorkflowDescription(tt.inputs)
192 assert.Equal(t, tt.expected, result)
193 })
194 }
195}
196
197func TestBuildCommandString(t *testing.T) {
198 tests := []struct {

Callers

nothing calls this directly

Calls 2

buildWorkflowDescriptionFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected