(t *testing.T)
| 293 | } |
| 294 | |
| 295 | func TestRm_ForceDeletesReferencedTask(t *testing.T) { |
| 296 | tmpDir := t.TempDir() |
| 297 | os.WriteFile(filepath.Join(tmpDir, "001-setup.md"), []byte(rmTaskPending), 0644) |
| 298 | depTask := `--- |
| 299 | id: "003" |
| 300 | title: "Depends on setup" |
| 301 | status: pending |
| 302 | priority: medium |
| 303 | effort: small |
| 304 | dependencies: ["001"] |
| 305 | tags: [] |
| 306 | created: 2026-02-08 |
| 307 | --- |
| 308 | |
| 309 | # Depends on setup |
| 310 | ` |
| 311 | os.WriteFile(filepath.Join(tmpDir, "003-dep.md"), []byte(depTask), 0644) |
| 312 | |
| 313 | resetRmFlags() |
| 314 | taskDir = tmpDir |
| 315 | rmForce = true |
| 316 | |
| 317 | output, err := captureRmOutput(t, []string{"001"}) |
| 318 | if err != nil { |
| 319 | t.Fatalf("expected --force to override reference check, got: %v", err) |
| 320 | } |
| 321 | if !strings.Contains(output, "Deleted 1 task") { |
| 322 | t.Errorf("expected delete confirmation, got: %s", output) |
| 323 | } |
| 324 | |
| 325 | if _, err := os.Stat(filepath.Join(tmpDir, "001-setup.md")); !os.IsNotExist(err) { |
| 326 | t.Error("expected file to be deleted with --force") |
| 327 | } |
| 328 | } |
| 329 | |
| 330 | func TestRm_DeletesWorklog(t *testing.T) { |
| 331 | tmpDir := t.TempDir() |
nothing calls this directly
no test coverage detected