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

Function TestListCommand_LimitTableOutput

apps/cli/internal/cli/list_test.go:446–469  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

444}
445
446func TestListCommand_LimitTableOutput(t *testing.T) {
447 resetListFlags()
448
449 tasks := []*model.Task{
450 {ID: "001", Title: "First", Status: model.StatusPending, Priority: model.PriorityHigh, FilePath: "a.md"},
451 {ID: "002", Title: "Second", Status: model.StatusPending, Priority: model.PriorityLow, FilePath: "b.md"},
452 {ID: "003", Title: "Third", Status: model.StatusPending, Priority: model.PriorityMedium, FilePath: "c.md"},
453 }
454
455 // Apply limit before outputting
456 limited := tasks[:2]
457
458 output := captureListTableOutput(t, limited, "id,title,status")
459
460 if !strings.Contains(output, "001") {
461 t.Error("Expected task 001 in output")
462 }
463 if !strings.Contains(output, "002") {
464 t.Error("Expected task 002 in output")
465 }
466 if strings.Contains(output, "003") {
467 t.Error("Task 003 should not appear in limited output")
468 }
469}
470
471func TestListCommand_LimitJSONOutput(t *testing.T) {
472 resetListFlags()

Callers

nothing calls this directly

Calls 3

resetListFlagsFunction · 0.85
captureListTableOutputFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected