(t *testing.T)
| 116 | } |
| 117 | |
| 118 | func TestSearch_MatchInTitle(t *testing.T) { |
| 119 | resetSearchFlags() |
| 120 | |
| 121 | tasks := []*model.Task{ |
| 122 | {ID: "001", Title: "Implement authentication system", Status: model.StatusPending, Priority: model.PriorityHigh, Body: "Some body text"}, |
| 123 | {ID: "002", Title: "Set up deployment", Status: model.StatusInProgress, Priority: model.PriorityMedium, Body: "Other content"}, |
| 124 | } |
| 125 | |
| 126 | results := search.Search(tasks, "authentication") |
| 127 | |
| 128 | if len(results) != 1 { |
| 129 | t.Fatalf("expected 1 result, got %d", len(results)) |
| 130 | } |
| 131 | if results[0].ID != "001" { |
| 132 | t.Errorf("expected task 001, got %s", results[0].ID) |
| 133 | } |
| 134 | if results[0].MatchLocation != "title" { |
| 135 | t.Errorf("expected match location 'title', got %s", results[0].MatchLocation) |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | func TestSearch_MatchInBody(t *testing.T) { |
| 140 | resetSearchFlags() |
nothing calls this directly
no test coverage detected