Skip to content

Commit f65479f

Browse files
ibbempiameier
authored andcommitted
feat: assert that there is at most one ELIF/ELSE
1 parent 5b5a4cb commit f65479f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/main/java/org/variantsync/diffdetective/variation/tree/VariationNode.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,12 @@ public void assertConsistency() {
549549
"The root has to have the feature mapping 'true'");
550550
}
551551

552+
// check that there is at most one ELIF/ELSE
553+
Assert.assertTrue(
554+
getChildren().stream().filter(c -> c.isElif() || c.isElse()).count() <= 1,
555+
"There is more than one ELIF/ELSE node."
556+
);
557+
552558
// check consistency of children lists and edges
553559
for (var child : getChildren()) {
554560
Assert.assertTrue(

0 commit comments

Comments
 (0)