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

Function captureRunList

apps/cli/internal/cli/list_test.go:568–586  ·  view source on GitHub ↗

captureRunList runs runList and captures stdout.

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

Source from the content-addressed store, hash-verified

566
567// captureRunList runs runList and captures stdout.
568func captureRunList(t *testing.T, args []string) string {
569 t.Helper()
570
571 oldStdout := os.Stdout
572 r, w, _ := os.Pipe()
573 os.Stdout = w
574
575 err := runList(listCmd, args)
576 w.Close()
577 os.Stdout = oldStdout
578
579 if err != nil {
580 t.Fatalf("runList failed: %v", err)
581 }
582
583 var buf bytes.Buffer
584 buf.ReadFrom(r)
585 return buf.String()
586}
587
588func TestListCommand_ScopeFilter(t *testing.T) {
589 tmpDir := createScopedListTaskFiles(t)

Callers 1

Calls 1

runListFunction · 0.85

Tested by

no test coverage detected