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

Function TestSearch_TableOutput

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

Source from the content-addressed store, hash-verified

304}
305
306func TestSearch_TableOutput(t *testing.T) {
307 resetSearchFlags()
308
309 tasks := []*model.Task{
310 {ID: "001", Title: "Auth system", Status: model.StatusPending, Priority: model.PriorityHigh, FilePath: "tasks/001.md", Body: "Implement authentication"},
311 }
312
313 output, err := captureSearchOutput(t, tasks, "authentication", "table")
314 if err != nil {
315 t.Fatalf("unexpected error: %v", err)
316 }
317
318 if !strings.Contains(output, "ID") || !strings.Contains(output, "TITLE") {
319 t.Error("expected table header with ID and TITLE")
320 }
321 if !strings.Contains(output, "PRIORITY") {
322 t.Error("expected table header with PRIORITY")
323 }
324 if !strings.Contains(output, "001") {
325 t.Error("expected task ID 001 in output")
326 }
327 if !strings.Contains(output, "Auth system") {
328 t.Error("expected task title in output")
329 }
330 if !strings.Contains(output, "high") {
331 t.Error("expected priority 'high' in output")
332 }
333}
334
335func TestSearchTasks_Unit(t *testing.T) {
336 tasks := []*model.Task{

Callers

nothing calls this directly

Calls 3

resetSearchFlagsFunction · 0.85
captureSearchOutputFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected