(t *testing.T)
| 444 | } |
| 445 | |
| 446 | func TestListCommand_LimitTableOutput(t *testing.T) { |
| 447 | resetListFlags() |
| 448 | |
| 449 | tasks := []*model.Task{ |
| 450 | {ID: "001", Title: "First", Status: model.StatusPending, Priority: model.PriorityHigh, FilePath: "a.md"}, |
| 451 | {ID: "002", Title: "Second", Status: model.StatusPending, Priority: model.PriorityLow, FilePath: "b.md"}, |
| 452 | {ID: "003", Title: "Third", Status: model.StatusPending, Priority: model.PriorityMedium, FilePath: "c.md"}, |
| 453 | } |
| 454 | |
| 455 | // Apply limit before outputting |
| 456 | limited := tasks[:2] |
| 457 | |
| 458 | output := captureListTableOutput(t, limited, "id,title,status") |
| 459 | |
| 460 | if !strings.Contains(output, "001") { |
| 461 | t.Error("Expected task 001 in output") |
| 462 | } |
| 463 | if !strings.Contains(output, "002") { |
| 464 | t.Error("Expected task 002 in output") |
| 465 | } |
| 466 | if strings.Contains(output, "003") { |
| 467 | t.Error("Task 003 should not appear in limited output") |
| 468 | } |
| 469 | } |
| 470 | |
| 471 | func TestListCommand_LimitJSONOutput(t *testing.T) { |
| 472 | resetListFlags() |
nothing calls this directly
no test coverage detected