(t *testing.T)
| 104 | } |
| 105 | |
| 106 | func TestRm_DryRun(t *testing.T) { |
| 107 | tmpDir := createRmTestFiles(t) |
| 108 | resetRmFlags() |
| 109 | taskDir = tmpDir |
| 110 | rmDryRun = true |
| 111 | |
| 112 | output, err := captureRmOutput(t, []string{"001"}) |
| 113 | if err != nil { |
| 114 | t.Fatalf("unexpected error: %v", err) |
| 115 | } |
| 116 | |
| 117 | if !strings.Contains(output, "Dry run") { |
| 118 | t.Errorf("expected dry run message, got: %s", output) |
| 119 | } |
| 120 | |
| 121 | if !strings.Contains(output, "Delete 1 task") { |
| 122 | t.Errorf("expected preview of task, got: %s", output) |
| 123 | } |
| 124 | |
| 125 | // File should NOT be deleted |
| 126 | if _, err := os.Stat(filepath.Join(tmpDir, "001-setup.md")); err != nil { |
| 127 | t.Error("expected file to remain after dry run") |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | func TestRm_TaskNotFound(t *testing.T) { |
| 132 | tmpDir := createRmTestFiles(t) |
nothing calls this directly
no test coverage detected