(t *testing.T)
| 256 | } |
| 257 | |
| 258 | func TestSearch_YAMLFormat(t *testing.T) { |
| 259 | resetSearchFlags() |
| 260 | |
| 261 | tasks := []*model.Task{ |
| 262 | {ID: "001", Title: "Auth system", Status: model.StatusPending, Priority: model.PriorityMedium, FilePath: "tasks/001.md", Body: "JWT authentication logic"}, |
| 263 | } |
| 264 | |
| 265 | output, err := captureSearchOutput(t, tasks, "authentication", "yaml") |
| 266 | if err != nil { |
| 267 | t.Fatalf("unexpected error: %v", err) |
| 268 | } |
| 269 | |
| 270 | if !strings.Contains(output, "id:") { |
| 271 | t.Error("expected YAML output to contain 'id:'") |
| 272 | } |
| 273 | if !strings.Contains(output, "match_location:") { |
| 274 | t.Error("expected YAML output to contain 'match_location:'") |
| 275 | } |
| 276 | if !strings.Contains(output, "snippet:") { |
| 277 | t.Error("expected YAML output to contain 'snippet:'") |
| 278 | } |
| 279 | if !strings.Contains(output, "priority:") { |
| 280 | t.Error("expected YAML output to contain 'priority:'") |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | func TestSearch_UnsupportedFormat(t *testing.T) { |
| 285 | resetSearchFlags() |
nothing calls this directly
no test coverage detected