Skip to content

Commit fb3f277

Browse files
committed
test: cover explicit empty else merge flow
Symptom: the PR regression test used an empty ElseBody without marking that the source contained an explicit ELSE token. Root cause: the empty-ELSE builder fix depends on IfStmt.HasElse, introduced by the custom error-handler routing branch, to distinguish a missing ELSE from an explicitly empty ELSE. Fix: stack this branch on the HasElse change and set HasElse in the regression test so it exercises the explicit empty-ELSE path. Tests: go test ./mdl/executor -run TestIfEmptyElseBodyWithContinuingThenEmitsFalseFlowToMerge -v; make build; make test; make lint-go.
1 parent 4deb554 commit fb3f277

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

mdl/executor/cmd_microflows_builder_empty_else_merge_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ func TestIfEmptyElseBodyWithContinuingThenEmitsFalseFlowToMerge(t *testing.T) {
2929
ThenBody: []ast.MicroflowStatement{
3030
&ast.LogStmt{Level: ast.LogInfo, Message: &ast.LiteralExpr{Kind: ast.LiteralString, Value: "in-then"}},
3131
},
32-
// ElseBody deliberately empty (0 statements). Len-based hasElseBody is
33-
// false in this case, so this narrow test drives the "non-hasElseBody"
34-
// path. For the hasElseBody + empty body case, see below.
32+
// The source had an explicit ELSE token, but no statements in that
33+
// branch. That must still build a false split->merge flow.
34+
HasElse: true,
3535
})
3636

3737
var split *microflows.ExclusiveSplit

0 commit comments

Comments
 (0)