(t *testing.T)
| 304 | } |
| 305 | |
| 306 | func TestSearch_TableOutput(t *testing.T) { |
| 307 | resetSearchFlags() |
| 308 | |
| 309 | tasks := []*model.Task{ |
| 310 | {ID: "001", Title: "Auth system", Status: model.StatusPending, Priority: model.PriorityHigh, FilePath: "tasks/001.md", Body: "Implement authentication"}, |
| 311 | } |
| 312 | |
| 313 | output, err := captureSearchOutput(t, tasks, "authentication", "table") |
| 314 | if err != nil { |
| 315 | t.Fatalf("unexpected error: %v", err) |
| 316 | } |
| 317 | |
| 318 | if !strings.Contains(output, "ID") || !strings.Contains(output, "TITLE") { |
| 319 | t.Error("expected table header with ID and TITLE") |
| 320 | } |
| 321 | if !strings.Contains(output, "PRIORITY") { |
| 322 | t.Error("expected table header with PRIORITY") |
| 323 | } |
| 324 | if !strings.Contains(output, "001") { |
| 325 | t.Error("expected task ID 001 in output") |
| 326 | } |
| 327 | if !strings.Contains(output, "Auth system") { |
| 328 | t.Error("expected task title in output") |
| 329 | } |
| 330 | if !strings.Contains(output, "high") { |
| 331 | t.Error("expected priority 'high' in output") |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | func TestSearchTasks_Unit(t *testing.T) { |
| 336 | tasks := []*model.Task{ |
nothing calls this directly
no test coverage detected