(t *testing.T)
| 151 | } |
| 152 | |
| 153 | func TestIsCompleted(t *testing.T) { |
| 154 | tests := []struct { |
| 155 | name string |
| 156 | status Status |
| 157 | expected bool |
| 158 | }{ |
| 159 | {"draft", StatusDraft, false}, |
| 160 | {"pending approval", StatusPendingApproval, false}, |
| 161 | {"approved", StatusApproved, false}, |
| 162 | {"executing", StatusExecuting, false}, |
| 163 | {"completed", StatusCompleted, true}, |
| 164 | {"failed", StatusFailed, true}, |
| 165 | {"canceled", StatusCancelled, true}, |
| 166 | {"partial", StatusPartial, false}, |
| 167 | } |
| 168 | |
| 169 | for _, tt := range tests { |
| 170 | t.Run(tt.name, func(t *testing.T) { |
| 171 | plan := NewExecutionPlan("Test") |
| 172 | plan.Status = tt.status |
| 173 | if plan.IsCompleted() != tt.expected { |
| 174 | t.Errorf("expected %v, got %v", tt.expected, plan.IsCompleted()) |
| 175 | } |
| 176 | }) |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | func TestIsApproved(t *testing.T) { |
| 181 | tests := []struct { |
nothing calls this directly
no test coverage detected