(t *testing.T)
| 340 | } |
| 341 | |
| 342 | func TestMarkStepFailed(t *testing.T) { |
| 343 | plan := NewExecutionPlan("Test plan") |
| 344 | plan.AddStep("tool1", "Step 1", nil) |
| 345 | |
| 346 | plan.MarkStepStarted(0) |
| 347 | testErr := errors.New("test error") |
| 348 | plan.MarkStepFailed(0, testErr) |
| 349 | |
| 350 | step := plan.GetStep(0) |
| 351 | if step.Status != StepStatusFailed { |
| 352 | t.Errorf("expected status %v, got %v", StepStatusFailed, step.Status) |
| 353 | } |
| 354 | |
| 355 | if step.Error != testErr.Error() { |
| 356 | t.Errorf("expected error %q, got %q", testErr.Error(), step.Error) |
| 357 | } |
| 358 | |
| 359 | if step.CompletedAt == nil { |
| 360 | t.Error("expected CompletedAt to be set") |
| 361 | } |
| 362 | |
| 363 | // Invalid index should not panic |
| 364 | plan.MarkStepFailed(-1, testErr) |
| 365 | plan.MarkStepFailed(100, testErr) |
| 366 | } |
| 367 | |
| 368 | func TestSummary(t *testing.T) { |
| 369 | plan := NewExecutionPlan("Test plan") |
nothing calls this directly
no test coverage detected