MCPcopy Create free account
hub / github.com/astercloud/aster / TestSummaryEmptyPlan

Function TestSummaryEmptyPlan

pkg/executionplan/types_test.go:411–423  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

409}
410
411func TestSummaryEmptyPlan(t *testing.T) {
412 plan := NewExecutionPlan("Empty plan")
413 summary := plan.Summary()
414
415 if summary.TotalSteps != 0 {
416 t.Errorf("expected TotalSteps 0, got %d", summary.TotalSteps)
417 }
418
419 // Division by zero protection - Progress should be 0 or NaN
420 if summary.Progress != 0 && !isNaN(summary.Progress) {
421 t.Errorf("expected Progress 0 or NaN for empty plan, got %f", summary.Progress)
422 }
423}
424
425func isNaN(f float64) bool {
426 return f != f

Callers

nothing calls this directly

Calls 3

SummaryMethod · 0.95
NewExecutionPlanFunction · 0.85
isNaNFunction · 0.85

Tested by

no test coverage detected