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

Function TestNewGraph

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

Source from the content-addressed store, hash-verified

44}
45
46func TestNewGraph(t *testing.T) {
47 tasks := createTestTasks()
48 g := NewGraph(tasks)
49
50 if len(g.Tasks) != 5 {
51 t.Errorf("Expected 5 tasks, got %d", len(g.Tasks))
52 }
53
54 if len(g.TaskMap) != 5 {
55 t.Errorf("Expected 5 tasks in map, got %d", len(g.TaskMap))
56 }
57
58 // Check adjacency (T1 blocks T2 and T3)
59 if len(g.Adjacency["T1"]) != 2 {
60 t.Errorf("Expected T1 to block 2 tasks, got %d", len(g.Adjacency["T1"]))
61 }
62
63 // Check reverse adjacency (T3 depends on T1 and T2)
64 if len(g.RevAdjacency["T3"]) != 2 {
65 t.Errorf("Expected T3 to depend on 2 tasks, got %d", len(g.RevAdjacency["T3"]))
66 }
67}
68
69func TestGetDownstream(t *testing.T) {
70 tasks := createTestTasks()

Callers

nothing calls this directly

Calls 2

createTestTasksFunction · 0.85
NewGraphFunction · 0.85

Tested by

no test coverage detected