(t *testing.T)
| 279 | } |
| 280 | |
| 281 | func TestMarkStepStarted(t *testing.T) { |
| 282 | plan := NewExecutionPlan("Test plan") |
| 283 | plan.AddStep("tool1", "Step 1", nil) |
| 284 | plan.AddStep("tool2", "Step 2", nil) |
| 285 | |
| 286 | plan.MarkStepStarted(0) |
| 287 | |
| 288 | step := plan.GetStep(0) |
| 289 | if step.Status != StepStatusRunning { |
| 290 | t.Errorf("expected status %v, got %v", StepStatusRunning, step.Status) |
| 291 | } |
| 292 | |
| 293 | if step.StartedAt == nil { |
| 294 | t.Error("expected StartedAt to be set") |
| 295 | } |
| 296 | |
| 297 | if plan.CurrentStep != 0 { |
| 298 | t.Errorf("expected CurrentStep 0, got %d", plan.CurrentStep) |
| 299 | } |
| 300 | |
| 301 | // Mark second step |
| 302 | plan.MarkStepStarted(1) |
| 303 | if plan.CurrentStep != 1 { |
| 304 | t.Errorf("expected CurrentStep 1, got %d", plan.CurrentStep) |
| 305 | } |
| 306 | |
| 307 | // Invalid index should not panic |
| 308 | plan.MarkStepStarted(-1) |
| 309 | plan.MarkStepStarted(100) |
| 310 | } |
| 311 | |
| 312 | func TestMarkStepCompleted(t *testing.T) { |
| 313 | plan := NewExecutionPlan("Test plan") |
nothing calls this directly
no test coverage detected