(t *testing.T)
| 422 | } |
| 423 | |
| 424 | func TestStatus_ChildrenTree_Circular(t *testing.T) { |
| 425 | tmpDir := t.TempDir() |
| 426 | |
| 427 | tasks := map[string]string{ |
| 428 | "020-a.md": `--- |
| 429 | id: "020" |
| 430 | title: "Task A" |
| 431 | status: pending |
| 432 | parent: "021" |
| 433 | tags: [] |
| 434 | dependencies: [] |
| 435 | --- |
| 436 | `, |
| 437 | "021-b.md": `--- |
| 438 | id: "021" |
| 439 | title: "Task B" |
| 440 | status: pending |
| 441 | parent: "020" |
| 442 | tags: [] |
| 443 | dependencies: [] |
| 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 | |
| 466 | func TestStatus_MinimalFlag(t *testing.T) { |
| 467 | tmpDir := createStatusTestFilesWithChildren(t) |
nothing calls this directly
no test coverage detected