MCPcopy Create free account
hub / github.com/diillson/chatcli / TestTaskTracker_MarkByID_HappyPath

Function TestTaskTracker_MarkByID_HappyPath

cli/agent/task_tracker_test.go:144–157  ·  view source on GitHub ↗

TestTaskTracker_MarkByID_HappyPath pins the single-item update.

(t *testing.T)

Source from the content-addressed store, hash-verified

142
143// TestTaskTracker_MarkByID_HappyPath pins the single-item update.
144func TestTaskTracker_MarkByID_HappyPath(t *testing.T) {
145 tracker := NewTaskTracker(zap.NewNop())
146 tracker.SetTasks([]TaskSpec{
147 {Description: "a", Status: TaskPending},
148 {Description: "b", Status: TaskPending},
149 })
150 if !tracker.MarkByID(2, TaskCompleted, "") {
151 t.Fatal("MarkByID must return true for valid id")
152 }
153 plan := tracker.GetPlan()
154 if plan.Tasks[1].Status != TaskCompleted {
155 t.Errorf("task[1] status: want completed, got %v", plan.Tasks[1].Status)
156 }
157}
158
159// TestTaskTracker_MarkByID_OutOfRange returns false safely.
160func TestTaskTracker_MarkByID_OutOfRange(t *testing.T) {

Callers

nothing calls this directly

Calls 5

SetTasksMethod · 0.95
MarkByIDMethod · 0.95
GetPlanMethod · 0.95
NewTaskTrackerFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected