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

Function captureListOutput

apps/cli/internal/cli/edge_cases_test.go:13–28  ·  view source on GitHub ↗

--- Helpers ---

(t *testing.T, scanDir string)

Source from the content-addressed store, hash-verified

11// --- Helpers ---
12
13func captureListOutput(t *testing.T, scanDir string) (string, error) {
14 t.Helper()
15
16 oldStdout := os.Stdout
17 r, w, _ := os.Pipe()
18 os.Stdout = w
19
20 err := runList(listCmd, []string{scanDir})
21
22 w.Close()
23 os.Stdout = oldStdout
24
25 var buf bytes.Buffer
26 buf.ReadFrom(r)
27 return buf.String(), err
28}
29
30// --- Empty directory ---
31

Callers 8

TestEdge_EmptyFileFunction · 0.85
TestEdge_InvalidFormatFunction · 0.85

Calls 1

runListFunction · 0.85

Tested by

no test coverage detected