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

Function captureContextOutput

apps/cli/internal/cli/context_test.go:140–155  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

138}
139
140func captureContextOutput(t *testing.T) (string, error) {
141 t.Helper()
142
143 oldStdout := os.Stdout
144 r, w, _ := os.Pipe()
145 os.Stdout = w
146
147 err := runContext(contextCmd, nil)
148
149 w.Close()
150 os.Stdout = oldStdout
151
152 var buf bytes.Buffer
153 buf.ReadFrom(r)
154 return buf.String(), err
155}
156
157func TestContext_TouchesOnly(t *testing.T) {
158 tmpDir := createContextTestFiles(t)

Callers 14

TestContext_TouchesOnlyFunction · 0.85
TestContext_ExplicitOnlyFunction · 0.85
TestContext_BothSourcesFunction · 0.85
TestContext_EmptyTaskFunction · 0.85
TestContext_TaskNotFoundFunction · 0.85
TestContext_MissingFilesFunction · 0.85
TestContext_JSONFunction · 0.85
TestContext_YAMLFunction · 0.85
TestContext_IncludeDepsFunction · 0.85
TestContext_MaxFilesFunction · 0.85

Calls 1

runContextFunction · 0.85

Tested by

no test coverage detected