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

Function captureReportOutput

apps/cli/internal/cli/report_test.go:124–144  ·  view source on GitHub ↗
(t *testing.T, dir string)

Source from the content-addressed store, hash-verified

122}
123
124func captureReportOutput(t *testing.T, dir string) string {
125 t.Helper()
126
127 oldStdout := os.Stdout
128 r, w, _ := os.Pipe()
129 os.Stdout = w
130
131 err := runReport(reportCmd, []string{dir})
132 if err != nil {
133 w.Close()
134 os.Stdout = oldStdout
135 t.Fatalf("runReport failed: %v", err)
136 }
137
138 w.Close()
139 os.Stdout = oldStdout
140
141 var buf bytes.Buffer
142 buf.ReadFrom(r)
143 return buf.String()
144}
145
146// --- Markdown tests ---
147

Calls 1

runReportFunction · 0.85

Tested by

no test coverage detected