(t *testing.T)
| 78 | } |
| 79 | |
| 80 | func TestRm_WithForce(t *testing.T) { |
| 81 | tmpDir := createRmTestFiles(t) |
| 82 | resetRmFlags() |
| 83 | taskDir = tmpDir |
| 84 | rmForce = true |
| 85 | |
| 86 | output, err := captureRmOutput(t, []string{"001"}) |
| 87 | if err != nil { |
| 88 | t.Fatalf("unexpected error: %v", err) |
| 89 | } |
| 90 | |
| 91 | if !strings.Contains(output, "Deleted 1 task") { |
| 92 | t.Errorf("expected delete confirmation, got: %s", output) |
| 93 | } |
| 94 | |
| 95 | // File should be gone |
| 96 | if _, err := os.Stat(filepath.Join(tmpDir, "001-setup.md")); !os.IsNotExist(err) { |
| 97 | t.Error("expected file to be deleted") |
| 98 | } |
| 99 | |
| 100 | // Other file should remain |
| 101 | if _, err := os.Stat(filepath.Join(tmpDir, "002-old.md")); err != nil { |
| 102 | t.Error("expected other file to remain") |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | func TestRm_DryRun(t *testing.T) { |
| 107 | tmpDir := createRmTestFiles(t) |
nothing calls this directly
no test coverage detected