MCPcopy Create free account
hub / github.com/openclaw/gogcli / executeWithTestRuntime

Function executeWithTestRuntime

internal/cmd/cmd_testutil_test.go:202–227  ·  view source on GitHub ↗
(t *testing.T, args []string, runtime *app.Runtime)

Source from the content-addressed store, hash-verified

200}
201
202func executeWithTestRuntime(t *testing.T, args []string, runtime *app.Runtime) executeTestResult {
203 t.Helper()
204
205 var stdout bytes.Buffer
206 var stderr bytes.Buffer
207 if runtime == nil {
208 runtime = &app.Runtime{}
209 } else {
210 runtimeCopy := *runtime
211 runtime = &runtimeCopy
212 }
213 if runtime.KeyringOptions == nil {
214 runtime.KeyringOptions = testKeyringOptions()
215 }
216 runtime.IO = app.IO{
217 In: strings.NewReader(""),
218 Out: &stdout,
219 Err: &stderr,
220 }
221 err := executeWithRuntime(args, runtime)
222 return executeTestResult{
223 stdout: stdout.String(),
224 stderr: stderr.String(),
225 err: err,
226 }
227}

Calls 3

testKeyringOptionsFunction · 0.85
executeWithRuntimeFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected