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

Function TestStatus_ChildrenTree_Circular

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

Source from the content-addressed store, hash-verified

422}
423
424func TestStatus_ChildrenTree_Circular(t *testing.T) {
425 tmpDir := t.TempDir()
426
427 tasks := map[string]string{
428 "020-a.md": `---
429id: "020"
430title: "Task A"
431status: pending
432parent: "021"
433tags: []
434dependencies: []
435---
436`,
437 "021-b.md": `---
438id: "021"
439title: "Task B"
440status: pending
441parent: "020"
442tags: []
443dependencies: []
444---
445`,
446 }
447
448 for filename, content := range tasks {
449 path := filepath.Join(tmpDir, filename)
450 if err := os.WriteFile(path, []byte(content), 0644); err != nil {
451 t.Fatalf("Failed to create test file %s: %v", filename, err)
452 }
453 }
454
455 resetStatusFlags()
456 taskDir = tmpDir
457
458 // Should not hang or panic
459 output := captureStatusOutput(t, "020")
460
461 if !strings.Contains(output, "Task: 020") {
462 t.Error("Expected output to contain 'Task: 020'")
463 }
464}
465
466func TestStatus_MinimalFlag(t *testing.T) {
467 tmpDir := createStatusTestFilesWithChildren(t)

Callers

nothing calls this directly

Calls 3

resetStatusFlagsFunction · 0.85
captureStatusOutputFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected