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

Function TestHighlightMatch

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

Source from the content-addressed store, hash-verified

368}
369
370func TestHighlightMatch(t *testing.T) {
371 noColor = true
372 r := getRenderer()
373
374 result := highlightMatch("contains keyword here", "keyword", r)
375 if !strings.Contains(result, "keyword") {
376 t.Error("expected highlighted text to contain the match")
377 }
378
379 // When no match found, return original
380 result = highlightMatch("no match", "xyz", r)
381 if result != "no match" {
382 t.Errorf("expected original text, got %q", result)
383 }
384}
385
386func TestSearch_FilterByPriority(t *testing.T) {
387 resetSearchFlags()

Callers

nothing calls this directly

Calls 3

getRendererFunction · 0.85
highlightMatchFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected