tests are working now

parent eb17de08
Pipeline #197558 failed with stage
in 1 minute and 5 seconds
......@@ -21,6 +21,8 @@
package de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAComponentInstantiationSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc.types.EMAVariable;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.EmbeddedMontiArcMathScope;
import de.monticore.lang.math.TextualRepresentationCalculator;
import de.monticore.symboltable.Scope;
......@@ -72,20 +74,32 @@ public class ExpandedComponentInstanceTest extends AbstractSymtabTest {
@Test
public void testLookUp() throws Exception {
EmbeddedMontiArcMathScope symTab = createSymTab("src/test/resources");
EMAComponentSymbol componentSymbol = symTab.resolveEMAComponent(
"testing.BasicLookUpInstance").orElse(null);
assertNotNull(componentSymbol);
assertEquals(3, componentSymbol.getSubComponents().size());
Iterator<EMAComponentInstantiationSymbol> iter = componentSymbol.getSubComponents().iterator();
EMAComponentInstantiationSymbol symbol = iter.next();
for (EMAVariable astExpression : symbol.getParameters()) {
Log.info(astExpression.toString(), "comp info3:");
}
EMAComponentInstantiationSymbol inst = symTab.resolveEMAComponentInstantiation(
"testing.basicLookUpInstance").orElse(null);
assertNotNull(inst);
assertEquals(3, inst.getSubComponents().size());
for (ASTExpression astExpression : inst.getSubComponents().iterator().next().getArguments()) {
Log.info(astExpression.toString(), "info:");
for (EMAVariable astExpression : inst.getSubComponents().iterator().next().getParameters()) {
Log.info(astExpression.toString(), "inst info3:");
}
Iterator<EMAComponentInstantiationSymbol> iterator = inst.getSubComponents().iterator();
ASTExpression symbol1 = iterator.next().getArguments().get(0);
ASTExpression symbol2 = iterator.next().getArguments().get(0);
ASTExpression symbol3 = iterator.next().getArguments().get(0);
assertEquals("[(0, 1, 2, 3)]", TextualRepresentationCalculator.getTextualRepresentation(symbol1));
assertEquals("[(0, 5, 4, 4)]", TextualRepresentationCalculator.getTextualRepresentation(symbol2));
assertEquals("[(1, 2, 7, 9)]", TextualRepresentationCalculator.getTextualRepresentation(symbol3));
assertEquals("[0, 1, 2, 3]", TextualRepresentationCalculator.getTextualRepresentation(symbol1));
assertEquals("[0, 5, 4, 4]", TextualRepresentationCalculator.getTextualRepresentation(symbol2));
assertEquals("[1, 2, 7, 9]", TextualRepresentationCalculator.getTextualRepresentation(symbol3));
iterator = inst.getSubComponents().iterator();
assertEquals(1,iterator.next().getArguments().size());
assertEquals(1,iterator.next().getArguments().size());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment