(t *testing.T)
| 44 | } |
| 45 | |
| 46 | func 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 | |
| 69 | func TestGetDownstream(t *testing.T) { |
| 70 | tasks := createTestTasks() |
nothing calls this directly
no test coverage detected