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

Function TestGetColumnValue

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

Source from the content-addressed store, hash-verified

50}
51
52func TestGetColumnValue(t *testing.T) {
53 created := time.Date(2026, 2, 8, 0, 0, 0, 0, time.UTC)
54 task := &model.Task{
55 ID: "001",
56 Title: "Test Task",
57 Status: model.StatusPending,
58 Priority: model.PriorityHigh,
59 Effort: model.EffortSmall,
60 Group: "testing",
61 Owner: "alice",
62 Created: model.NewFlexibleTime(created),
63 Dependencies: []string{"002", "003"},
64 Tags: []string{"cli", "test"},
65 }
66
67 tests := []struct {
68 name string
69 column string
70 expected string
71 }{
72 {"id column", "id", "001"},
73 {"title column", "title", "Test Task"},
74 {"status column", "status", "pending"},
75 {"priority column", "priority", "high"},
76 {"effort column", "effort", "small"},
77 {"group column", "group", "testing"},
78 {"owner column", "owner", "alice"},
79 {"created column", "created", "2026-02-08"},
80 {"deps column", "deps", "002,003"},
81 {"tags column", "tags", "cli,test"},
82 {"unknown column", "unknown", ""},
83 }
84
85 for _, tt := range tests {
86 t.Run(tt.name, func(t *testing.T) {
87 result := getColumnValue(task, tt.column)
88 if result != tt.expected {
89 t.Errorf("getColumnValue(%s) = %s, want %s", tt.column, result, tt.expected)
90 }
91 })
92 }
93}
94
95// resetListFlags resets list command flags to defaults before each test.
96func resetListFlags() {

Callers

nothing calls this directly

Calls 1

getColumnValueFunction · 0.85

Tested by

no test coverage detected