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

Function TestSearch_MatchInTitleAndBody

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

Source from the content-addressed store, hash-verified

191}
192
193func TestSearch_MatchInTitleAndBody(t *testing.T) {
194 resetSearchFlags()
195
196 tasks := []*model.Task{
197 {ID: "001", Title: "Authentication system", Status: model.StatusPending, Priority: model.PriorityHigh, Body: "Implement authentication with JWT"},
198 }
199
200 results := search.Search(tasks, "authentication")
201
202 if len(results) != 1 {
203 t.Fatalf("expected 1 result, got %d", len(results))
204 }
205 if results[0].MatchLocation != "title,body" {
206 t.Errorf("expected match location 'title,body', got %s", results[0].MatchLocation)
207 }
208}
209
210func TestSearch_NoResults(t *testing.T) {
211 resetSearchFlags()

Callers

nothing calls this directly

Calls 1

resetSearchFlagsFunction · 0.85

Tested by

no test coverage detected