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

Function captureSnapshotOutput

apps/cli/internal/cli/snapshot_test.go:94–109  ·  view source on GitHub ↗

captureSnapshotOutput runs the snapshot command and captures stdout.

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

Source from the content-addressed store, hash-verified

92
93// captureSnapshotOutput runs the snapshot command and captures stdout.
94func captureSnapshotOutput(t *testing.T, args []string) (string, error) {
95 t.Helper()
96
97 oldStdout := os.Stdout
98 r, w, _ := os.Pipe()
99 os.Stdout = w
100
101 err := runSnapshot(snapshotCmd, args)
102
103 w.Close()
104 os.Stdout = oldStdout
105
106 var buf bytes.Buffer
107 buf.ReadFrom(r)
108 return buf.String(), err
109}
110
111// --- Analysis function tests (pure, no I/O) ---
112

Calls 1

runSnapshotFunction · 0.85

Tested by

no test coverage detected