MCPcopy Create free account
hub / github.com/driangle/taskmd / TestSearch_YAMLFormat

Function TestSearch_YAMLFormat

apps/cli/internal/cli/search_test.go:258–282  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

256}
257
258func 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
284func TestSearch_UnsupportedFormat(t *testing.T) {
285 resetSearchFlags()

Callers

nothing calls this directly

Calls 3

resetSearchFlagsFunction · 0.85
captureSearchOutputFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected