MCPcopy Create free account
hub / github.com/driangle/taskmd / captureSetOutputWithArgs

Function captureSetOutputWithArgs

apps/cli/internal/cli/set_test.go:143–158  ·  view source on GitHub ↗
(t *testing.T, args []string)

Source from the content-addressed store, hash-verified

141}
142
143func captureSetOutputWithArgs(t *testing.T, args []string) (string, error) {
144 t.Helper()
145
146 oldStdout := os.Stdout
147 r, w, _ := os.Pipe()
148 os.Stdout = w
149
150 err := runSet(setCmd, args)
151
152 w.Close()
153 os.Stdout = oldStdout
154
155 var buf bytes.Buffer
156 buf.ReadFrom(r)
157 return buf.String(), err
158}
159
160func TestSet_Status(t *testing.T) {
161 tmpDir := createSetTestFiles(t)

Calls 1

runSetFunction · 0.85

Tested by

no test coverage detected