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

Function captureValidateOutput

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

Source from the content-addressed store, hash-verified

106}
107
108func captureValidateOutput(t *testing.T, args []string) (string, error) {
109 t.Helper()
110
111 oldStdout := os.Stdout
112 r, w, _ := os.Pipe()
113 os.Stdout = w
114
115 err := runValidate(validateCmd, args)
116
117 w.Close()
118 os.Stdout = oldStdout
119
120 var buf bytes.Buffer
121 buf.ReadFrom(r)
122 return buf.String(), err
123}
124
125// --- Unit tests (no file I/O) ---
126

Calls 1

runValidateFunction · 0.85

Tested by

no test coverage detected