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

Function TestTaskToSnapshot_WithDerived

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

Source from the content-addressed store, hash-verified

331}
332
333func TestTaskToSnapshot_WithDerived(t *testing.T) {
334 tasks := []*model.Task{
335 {ID: "001", Status: model.StatusCompleted, Dependencies: []string{}},
336 {ID: "002", Status: model.StatusPending, Dependencies: []string{"001"}},
337 }
338 taskMap := buildTaskMap(tasks)
339 depthMap := calculateDepthMap(tasks, taskMap)
340 topoOrder := calculateTopologicalOrder(tasks, taskMap)
341 criticalPath := calculateCriticalPathTasks(tasks, taskMap)
342
343 snapshot := taskToSnapshot(tasks[1], false, true, depthMap, topoOrder, criticalPath, taskMap)
344
345 if snapshot.IsBlocked == nil {
346 t.Fatal("expected IsBlocked to be set")
347 }
348 if snapshot.DependencyDepth == nil {
349 t.Fatal("expected DependencyDepth to be set")
350 }
351 if snapshot.TopologicalOrder == nil {
352 t.Fatal("expected TopologicalOrder to be set")
353 }
354}
355
356// --- Command-level tests ---
357

Callers

nothing calls this directly

Calls 5

buildTaskMapFunction · 0.85
taskToSnapshotFunction · 0.85
calculateDepthMapFunction · 0.70

Tested by

no test coverage detected