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

Function createStatsPhaseTestFiles

apps/cli/internal/cli/stats_test.go:221–261  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

219}
220
221func createStatsPhaseTestFiles(t *testing.T) string {
222 t.Helper()
223 tmpDir := t.TempDir()
224
225 tasks := map[string]string{
226 "001.md": `---
227id: "001"
228title: "V0.2 task A"
229status: pending
230priority: high
231phase: v0.2
232---`,
233 "002.md": `---
234id: "002"
235title: "V0.2 task B"
236status: completed
237priority: medium
238phase: v0.2
239---`,
240 "003.md": `---
241id: "003"
242title: "V0.3 task"
243status: pending
244priority: low
245phase: v0.3
246---`,
247 "004.md": `---
248id: "004"
249title: "No phase"
250status: pending
251priority: medium
252---`,
253 }
254
255 for filename, content := range tasks {
256 if err := os.WriteFile(filepath.Join(tmpDir, filename), []byte(content), 0644); err != nil {
257 t.Fatalf("failed to create test file %s: %v", filename, err)
258 }
259 }
260 return tmpDir
261}
262
263func TestRunStats_GroupByPhase_Table(t *testing.T) {
264 tmpDir := createStatsPhaseTestFiles(t)

Calls

no outgoing calls

Tested by

no test coverage detected