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

Function createStatusTestFilesWithChildren

apps/cli/internal/cli/status_test.go:300–359  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

298}
299
300func createStatusTestFilesWithChildren(t *testing.T) string {
301 t.Helper()
302
303 tmpDir := t.TempDir()
304
305 tasks := map[string]string{
306 "010-parent.md": `---
307id: "010"
308title: "Parent task"
309status: in-progress
310tags: []
311dependencies: []
312---
313
314# Parent task
315`,
316 "011-child-a.md": `---
317id: "011"
318title: "Child A"
319status: pending
320parent: "010"
321tags: []
322dependencies: []
323---
324
325# Child A
326`,
327 "012-child-b.md": `---
328id: "012"
329title: "Child B"
330status: completed
331parent: "010"
332tags: []
333dependencies: []
334---
335
336# Child B
337`,
338 "013-grandchild.md": `---
339id: "013"
340title: "Grandchild"
341status: pending
342parent: "011"
343tags: []
344dependencies: []
345---
346
347# Grandchild
348`,
349 }
350
351 for filename, content := range tasks {
352 path := filepath.Join(tmpDir, filename)
353 if err := os.WriteFile(path, []byte(content), 0644); err != nil {
354 t.Fatalf("Failed to create test file %s: %v", filename, err)
355 }
356 }
357

Callers 5

TestStatus_ChildrenTreeFunction · 0.85
TestStatus_MinimalFlagFunction · 0.85
TestStatus_NoChildrenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected