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

Function TestGetDownstream

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

Source from the content-addressed store, hash-verified

67}
68
69func TestGetDownstream(t *testing.T) {
70 tasks := createTestTasks()
71 g := NewGraph(tasks)
72
73 // T1 blocks T2, T3, T4 (via T2), T5 (via T3, T4)
74 downstream := g.GetDownstream("T1")
75
76 expectedDownstream := map[string]bool{
77 "T2": true,
78 "T3": true,
79 "T4": true,
80 "T5": true,
81 }
82
83 if len(downstream) != len(expectedDownstream) {
84 t.Errorf("Expected %d downstream tasks for T1, got %d", len(expectedDownstream), len(downstream))
85 }
86
87 for taskID := range expectedDownstream {
88 if !downstream[taskID] {
89 t.Errorf("Expected %s to be downstream of T1", taskID)
90 }
91 }
92}
93
94func TestGetUpstream(t *testing.T) {
95 tasks := createTestTasks()

Callers

nothing calls this directly

Calls 3

GetDownstreamMethod · 0.95
createTestTasksFunction · 0.85
NewGraphFunction · 0.85

Tested by

no test coverage detected