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

Function TestSearch_MatchInTitle

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

Source from the content-addressed store, hash-verified

116}
117
118func TestSearch_MatchInTitle(t *testing.T) {
119 resetSearchFlags()
120
121 tasks := []*model.Task{
122 {ID: "001", Title: "Implement authentication system", Status: model.StatusPending, Priority: model.PriorityHigh, Body: "Some body text"},
123 {ID: "002", Title: "Set up deployment", Status: model.StatusInProgress, Priority: model.PriorityMedium, Body: "Other content"},
124 }
125
126 results := search.Search(tasks, "authentication")
127
128 if len(results) != 1 {
129 t.Fatalf("expected 1 result, got %d", len(results))
130 }
131 if results[0].ID != "001" {
132 t.Errorf("expected task 001, got %s", results[0].ID)
133 }
134 if results[0].MatchLocation != "title" {
135 t.Errorf("expected match location 'title', got %s", results[0].MatchLocation)
136 }
137}
138
139func TestSearch_MatchInBody(t *testing.T) {
140 resetSearchFlags()

Callers

nothing calls this directly

Calls 1

resetSearchFlagsFunction · 0.85

Tested by

no test coverage detected