(t *testing.T)
| 194 | } |
| 195 | |
| 196 | func TestRm_InteractiveConfirmEmpty(t *testing.T) { |
| 197 | tmpDir := createRmTestFiles(t) |
| 198 | resetRmFlags() |
| 199 | taskDir = tmpDir |
| 200 | |
| 201 | // Simulate user pressing Enter (empty input = default No) |
| 202 | oldStdin := rmStdinReader |
| 203 | rmStdinReader = strings.NewReader("\n") |
| 204 | defer func() { rmStdinReader = oldStdin }() |
| 205 | |
| 206 | output, err := captureRmOutput(t, []string{"001"}) |
| 207 | if err != nil { |
| 208 | t.Fatalf("unexpected error: %v", err) |
| 209 | } |
| 210 | |
| 211 | if !strings.Contains(output, "Cancelled") { |
| 212 | t.Errorf("expected cancellation message, got: %s", output) |
| 213 | } |
| 214 | |
| 215 | // File should remain |
| 216 | if _, err := os.Stat(filepath.Join(tmpDir, "001-setup.md")); err != nil { |
| 217 | t.Error("expected file to remain after empty input") |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | func TestRm_BlockedByDependency(t *testing.T) { |
| 222 | tmpDir := t.TempDir() |
nothing calls this directly
no test coverage detected