(t *testing.T)
| 300 | } |
| 301 | |
| 302 | func TestAdd_SequentialIDs(t *testing.T) { |
| 303 | tmpDir := t.TempDir() |
| 304 | |
| 305 | // Create an existing task file |
| 306 | existing := `--- |
| 307 | id: "005" |
| 308 | title: "Existing task" |
| 309 | status: pending |
| 310 | priority: medium |
| 311 | dependencies: [] |
| 312 | tags: [] |
| 313 | created: 2026-02-16 |
| 314 | --- |
| 315 | |
| 316 | # Existing task |
| 317 | ` |
| 318 | if err := os.WriteFile(filepath.Join(tmpDir, "005-existing.md"), []byte(existing), 0644); err != nil { |
| 319 | t.Fatal(err) |
| 320 | } |
| 321 | |
| 322 | resetAddFlags() |
| 323 | taskDir = tmpDir |
| 324 | |
| 325 | output, err := captureAddOutput(t, "Next task") |
| 326 | if err != nil { |
| 327 | t.Fatalf("unexpected error: %v", err) |
| 328 | } |
| 329 | |
| 330 | if !strings.Contains(output, "Created task 006") { |
| 331 | t.Errorf("expected ID 006 (next after 005), got: %s", output) |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | func TestAdd_DependsOnParsing(t *testing.T) { |
| 336 | tmpDir := t.TempDir() |
nothing calls this directly
no test coverage detected