MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / execute

Function execute

internal/cli/cli_test.go:18–29  ·  view source on GitHub ↗

execute runs the App once with the given args and returns the captured streams + exit code. Tests share this helper so changes to App.Run flow only need to be applied in one place.

(t *testing.T, args ...string)

Source from the content-addressed store, hash-verified

16// streams + exit code. Tests share this helper so changes to App.Run flow
17// only need to be applied in one place.
18func execute(t *testing.T, args ...string) (stdout string, stderr string, code int) {
19 t.Helper()
20 var out, err bytes.Buffer
21 app := cli.New(cli.Options{
22 Version: "test-version",
23 Stdout: &out,
24 Stderr: &err,
25 Stdin: &bytes.Buffer{},
26 })
27 code = app.Run(args)
28 return out.String(), err.String(), code
29}
30
31// writeTempFile creates a file inside a t.TempDir with the given content and
32// returns its absolute path. Used by `add`-style command tests that need a

Calls 2

NewFunction · 0.92
RunMethod · 0.65

Tested by

no test coverage detected