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

Function createValidateTestFiles

apps/cli/internal/cli/validate_test.go:66–106  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

64}
65
66func createValidateTestFiles(t *testing.T) string {
67 t.Helper()
68 tmpDir := t.TempDir()
69
70 tasks := map[string]string{
71 "001-valid.md": `---
72id: "001"
73title: "Valid Task"
74status: pending
75priority: high
76effort: small
77dependencies: []
78tags: ["test"]
79created: 2026-02-08
80---
81
82A valid task.
83`,
84 "002-valid.md": `---
85id: "002"
86title: "Another Valid Task"
87status: completed
88priority: medium
89effort: medium
90dependencies: ["001"]
91tags: ["test"]
92created: 2026-02-08
93---
94
95Another valid task.
96`,
97 }
98
99 for filename, content := range tasks {
100 if err := os.WriteFile(filepath.Join(tmpDir, filename), []byte(content), 0644); err != nil {
101 t.Fatalf("failed to create test file %s: %v", filename, err)
102 }
103 }
104
105 return tmpDir
106}
107
108func captureValidateOutput(t *testing.T, args []string) (string, error) {
109 t.Helper()

Callers 3

Calls

no outgoing calls

Tested by

no test coverage detected