(t *testing.T)
| 271 | } |
| 272 | |
| 273 | func TestCalculateCriticalPathTasks(t *testing.T) { |
| 274 | // Chain: 001 <- 002 <- 003 (depth 3, longest) |
| 275 | // Branch: 001 <- 004 (depth 2, shorter) |
| 276 | tasks := []*model.Task{ |
| 277 | {ID: "001", Dependencies: []string{}}, |
| 278 | {ID: "002", Dependencies: []string{"001"}}, |
| 279 | {ID: "003", Dependencies: []string{"002"}}, |
| 280 | {ID: "004", Dependencies: []string{"001"}}, |
| 281 | } |
| 282 | taskMap := buildTaskMap(tasks) |
| 283 | critical := calculateCriticalPathTasks(tasks, taskMap) |
| 284 | |
| 285 | // 001, 002, 003 should be on critical path |
| 286 | if !critical["001"] { |
| 287 | t.Error("expected 001 on critical path") |
| 288 | } |
| 289 | if !critical["002"] { |
| 290 | t.Error("expected 002 on critical path") |
| 291 | } |
| 292 | if !critical["003"] { |
| 293 | t.Error("expected 003 on critical path") |
| 294 | } |
| 295 | // 004 is on a shorter branch |
| 296 | if critical["004"] { |
| 297 | t.Error("expected 004 NOT on critical path") |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | func TestTaskToSnapshot_CoreOnly(t *testing.T) { |
| 302 | task := &model.Task{ |
nothing calls this directly
no test coverage detected