Skip to content
Snippets Groups Projects
Commit 03b1771a authored by Johannes Mey's avatar Johannes Mey
Browse files

add test for constructor reordering with relations.

parent 49194f28
Branches
Tags
1 merge request!23add test for constructor reordering with relations.
Pipeline #20712 passed
......@@ -8,3 +8,10 @@ C : B ::= /<B8:long>/ /<B7>/ /[B6:A]/ /B5:A*/ /B4:A/ [B3:A] B2:A* B1:A;
rel A.r1 -> X;
rel S.r2* <-> Y.r2;
rel B.r3? -> X;
// testing reordering of children
Super ::= <Name>;
Order : Super ::= X MyY:Y;
ReOrder : Order ::= MyY:Y X;
rel Super.x -> X;
\ No newline at end of file
......@@ -70,6 +70,17 @@ public class ConstructorsTest {
Assertions.assertEquals(3, numberOfConstructors(B.class));
}
@Test
public void testReordering() {
String name = "";
X x = new X();
Y y = new Y();
Order o = new Order(name, x, y);
Assertions.assertEquals(3, numberOfConstructors(Order.class));
ReOrder ro = new ReOrder(name, y, x);
Assertions.assertEquals(3, numberOfConstructors(ReOrder.class));
}
private int numberOfConstructors(Class<?> clazz) {
return clazz.getConstructors().length;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment