TestTaskTracker_SetTasks pins the @todo write semantics: the full task list is replaced, statuses honored verbatim, and the CurrentTask cursor advances past any prefix of completed tasks.
(t *testing.T)
| 92 | // task list is replaced, statuses honored verbatim, and the |
| 93 | // CurrentTask cursor advances past any prefix of completed tasks. |
| 94 | func TestTaskTracker_SetTasks_FullReplacement(t *testing.T) { |
| 95 | tracker := NewTaskTracker(zap.NewNop()) |
| 96 | tracker.SetTasks([]TaskSpec{ |
| 97 | {Description: "first", Status: TaskCompleted}, |
| 98 | {Description: "second", Status: TaskCompleted}, |
| 99 | {Description: "third", Status: TaskPending}, |
| 100 | }) |
| 101 | plan := tracker.GetPlan() |
| 102 | if plan == nil { |
| 103 | t.Fatal("plan must be created") |
| 104 | } |
| 105 | if len(plan.Tasks) != 3 { |
| 106 | t.Fatalf("expected 3 tasks, got %d", len(plan.Tasks)) |
| 107 | } |
| 108 | if plan.CurrentTask != 2 { |
| 109 | t.Errorf("CurrentTask must advance past the two completed; got %d", plan.CurrentTask) |
| 110 | } |
| 111 | if plan.Tasks[0].Status != TaskCompleted { |
| 112 | t.Errorf("task[0] status: want completed, got %v", plan.Tasks[0].Status) |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | // TestTaskTracker_SetTasks_ExplicitInProgressFixesCurrent pins the |
| 117 | // non-prefix case: when one task is explicitly in_progress, the |
nothing calls this directly
no test coverage detected