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

Function TestSearch_MultipleResults

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

Source from the content-addressed store, hash-verified

175}
176
177func TestSearch_MultipleResults(t *testing.T) {
178 resetSearchFlags()
179
180 tasks := []*model.Task{
181 {ID: "001", Title: "Add authentication", Status: model.StatusPending, Priority: model.PriorityHigh, Body: "JWT auth"},
182 {ID: "002", Title: "Deploy service", Status: model.StatusInProgress, Priority: model.PriorityMedium, Body: "Deploy the authentication service"},
183 {ID: "003", Title: "Write docs", Status: model.StatusCompleted, Priority: model.PriorityLow, Body: "No match here"},
184 }
185
186 results := search.Search(tasks, "authentication")
187
188 if len(results) != 2 {
189 t.Fatalf("expected 2 results, got %d", len(results))
190 }
191}
192
193func TestSearch_MatchInTitleAndBody(t *testing.T) {
194 resetSearchFlags()

Callers

nothing calls this directly

Calls 1

resetSearchFlagsFunction · 0.85

Tested by

no test coverage detected