(t *testing.T)
| 137 | } |
| 138 | |
| 139 | func TestSearch_MatchInBody(t *testing.T) { |
| 140 | resetSearchFlags() |
| 141 | |
| 142 | tasks := []*model.Task{ |
| 143 | {ID: "001", Title: "Task one", Status: model.StatusPending, Priority: model.PriorityMedium, Body: "Contains the keyword deployment here"}, |
| 144 | {ID: "002", Title: "Task two", Status: model.StatusPending, Priority: model.PriorityLow, Body: "Nothing relevant"}, |
| 145 | } |
| 146 | |
| 147 | results := search.Search(tasks, "deployment") |
| 148 | |
| 149 | if len(results) != 1 { |
| 150 | t.Fatalf("expected 1 result, got %d", len(results)) |
| 151 | } |
| 152 | if results[0].ID != "001" { |
| 153 | t.Errorf("expected task 001, got %s", results[0].ID) |
| 154 | } |
| 155 | if results[0].MatchLocation != "body" { |
| 156 | t.Errorf("expected match location 'body', got %s", results[0].MatchLocation) |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | func TestSearch_CaseInsensitive(t *testing.T) { |
| 161 | resetSearchFlags() |
nothing calls this directly
no test coverage detected