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

Function captureStatusOutput

apps/cli/internal/cli/status_test.go:87–107  ·  view source on GitHub ↗
(t *testing.T, query string)

Source from the content-addressed store, hash-verified

85}
86
87func captureStatusOutput(t *testing.T, query string) string {
88 t.Helper()
89
90 oldStdout := os.Stdout
91 r, w, _ := os.Pipe()
92 os.Stdout = w
93
94 err := runStatus(statusCmd, []string{query})
95 if err != nil {
96 w.Close()
97 os.Stdout = oldStdout
98 t.Fatalf("runStatus failed: %v", err)
99 }
100
101 w.Close()
102 os.Stdout = oldStdout
103
104 var buf bytes.Buffer
105 buf.ReadFrom(r)
106 return buf.String()
107}
108
109func TestStatus_ExactMatchByID(t *testing.T) {
110 tmpDir := createStatusTestFiles(t)

Callers 15

TestStatus_TextFormatFunction · 0.85
TestStatus_JSONFormatFunction · 0.85
TestStatus_YAMLFormatFunction · 0.85
TestStatus_FuzzyMatchFunction · 0.85
TestStatus_ChildrenTreeFunction · 0.85
TestStatus_MinimalFlagFunction · 0.85
TestStatus_NoChildrenFunction · 0.85

Calls 1

runStatusFunction · 0.85

Tested by

no test coverage detected