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

Function TestCalculateCriticalPathTasks

apps/cli/internal/cli/snapshot_test.go:273–299  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

271}
272
273func 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
301func TestTaskToSnapshot_CoreOnly(t *testing.T) {
302 task := &model.Task{

Callers

nothing calls this directly

Calls 3

buildTaskMapFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected