(t *testing.T)
| 206 | } |
| 207 | |
| 208 | func TestCalculateDepthMap(t *testing.T) { |
| 209 | // Chain: 001 <- 002 <- 003 |
| 210 | tasks := []*model.Task{ |
| 211 | {ID: "001", Dependencies: []string{}}, |
| 212 | {ID: "002", Dependencies: []string{"001"}}, |
| 213 | {ID: "003", Dependencies: []string{"002"}}, |
| 214 | } |
| 215 | taskMap := buildTaskMap(tasks) |
| 216 | depthMap := calculateDepthMap(tasks, taskMap) |
| 217 | |
| 218 | if depthMap["001"] != 1 { |
| 219 | t.Errorf("depth[001] = %d, want 1", depthMap["001"]) |
| 220 | } |
| 221 | if depthMap["002"] != 2 { |
| 222 | t.Errorf("depth[002] = %d, want 2", depthMap["002"]) |
| 223 | } |
| 224 | if depthMap["003"] != 3 { |
| 225 | t.Errorf("depth[003] = %d, want 3", depthMap["003"]) |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | func TestCalculateDepthMap_NoDeps(t *testing.T) { |
| 230 | tasks := []*model.Task{ |
nothing calls this directly
no test coverage detected