Skip to content

Commit 08b13b7

Browse files
committed
test: allow explicit nested split branch form
Symptom: when combined with parent-merge join preservation, the nested empty-then fixture can remain an explicit if/else instead of being normalized to not(condition), while still preserving valid MDL. Root cause: the regression test asserted the cosmetic normalization form rather than the invariant fixed by this PR: split headers must be emitted once and closed once. Fix: keep the duplicate-header assertions and allow either normalized or explicit branch form. Tests: targeted executor traversal test.
1 parent 83c6ed3 commit 08b13b7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

mdl/executor/cmd_microflows_traverse_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -976,12 +976,12 @@ func TestTraverseFlowUntilMerge_NestedEmptyThenSwapEmitsHeaderOnce(t *testing.T)
976976
traverseFlowUntilMerge(e.newExecContext(context.Background()), mkID("split"), mkID("parentMerge"), activityMap, flowsByOrigin, nil, splitMergeMap, visited, nil, nil, &lines, 0, nil, 0, nil)
977977

978978
output := strings.Join(lines, "\n")
979-
if !strings.Contains(output, "if not($NestedDone) then") {
980-
t.Fatalf("expected negated nested condition, got:\n%s", output)
981-
}
982979
if strings.Count(output, "if ") != 1 {
983980
t.Fatalf("expected nested split header to be emitted once, got:\n%s", output)
984981
}
982+
if strings.Count(output, "end if;") != 1 {
983+
t.Fatalf("expected nested split to close exactly once, got:\n%s", output)
984+
}
985985
}
986986

987987
func TestTraverseFlow_BothBranchesToMerge_NoSwap(t *testing.T) {

0 commit comments

Comments
 (0)