(t *testing.T)
| 169 | } |
| 170 | |
| 171 | func TestRm_InteractiveConfirmNo(t *testing.T) { |
| 172 | tmpDir := createRmTestFiles(t) |
| 173 | resetRmFlags() |
| 174 | taskDir = tmpDir |
| 175 | |
| 176 | // Simulate user typing "n" |
| 177 | oldStdin := rmStdinReader |
| 178 | rmStdinReader = strings.NewReader("n\n") |
| 179 | defer func() { rmStdinReader = oldStdin }() |
| 180 | |
| 181 | output, err := captureRmOutput(t, []string{"001"}) |
| 182 | if err != nil { |
| 183 | t.Fatalf("unexpected error: %v", err) |
| 184 | } |
| 185 | |
| 186 | if !strings.Contains(output, "Cancelled") { |
| 187 | t.Errorf("expected cancellation message, got: %s", output) |
| 188 | } |
| 189 | |
| 190 | // File should remain |
| 191 | if _, err := os.Stat(filepath.Join(tmpDir, "001-setup.md")); err != nil { |
| 192 | t.Error("expected file to remain after declining") |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | func TestRm_InteractiveConfirmEmpty(t *testing.T) { |
| 197 | tmpDir := createRmTestFiles(t) |
nothing calls this directly
no test coverage detected