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

Function TestCalculateDepthMap

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

Source from the content-addressed store, hash-verified

206}
207
208func 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
229func TestCalculateDepthMap_NoDeps(t *testing.T) {
230 tasks := []*model.Task{

Callers

nothing calls this directly

Calls 2

buildTaskMapFunction · 0.85
calculateDepthMapFunction · 0.70

Tested by

no test coverage detected