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

Function TestFilterTasks

sdk/go/graph/graph_test.go:158–183  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

156}
157
158func TestFilterTasks(t *testing.T) {
159 tasks := createTestTasks()
160 g := NewGraph(tasks)
161
162 // Filter to only T1 and T2
163 filtered := g.FilterTasks(map[string]bool{
164 "T1": true,
165 "T2": true,
166 })
167
168 if len(filtered.Tasks) != 2 {
169 t.Errorf("Expected 2 filtered tasks, got %d", len(filtered.Tasks))
170 }
171
172 if _, exists := filtered.TaskMap["T1"]; !exists {
173 t.Error("Expected T1 in filtered graph")
174 }
175
176 if _, exists := filtered.TaskMap["T2"]; !exists {
177 t.Error("Expected T2 in filtered graph")
178 }
179
180 if _, exists := filtered.TaskMap["T3"]; exists {
181 t.Error("Did not expect T3 in filtered graph")
182 }
183}
184
185func TestToMermaid(t *testing.T) {
186 tasks := []*model.Task{

Callers

nothing calls this directly

Calls 4

FilterTasksMethod · 0.95
createTestTasksFunction · 0.85
NewGraphFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected