Search in sources :

Example 1 with AVariant

use of de.be4.eventbalg.core.parser.node.AVariant in project probparsers by bendisposto.

the class LexerTest method testStringVariant.

@Test
public void testStringVariant() throws BException {
    final Start rootNode = parseInput("machine Test\nvariant y-x\nend", false);
    final AMachineParseUnit parseUnit = (AMachineParseUnit) rootNode.getPParseUnit();
    final AVariant variantClause = (AVariant) parseUnit.getVariant();
    assertEquals("y-x", variantClause.getExpression().getText());
}
Also used : Start(de.be4.eventb.core.parser.node.Start) AVariant(de.be4.eventb.core.parser.node.AVariant) AMachineParseUnit(de.be4.eventb.core.parser.node.AMachineParseUnit) Test(org.junit.Test)

Example 2 with AVariant

use of de.be4.eventbalg.core.parser.node.AVariant in project probparsers by bendisposto.

the class LexerTest method testStringVariant.

@Test
public void testStringVariant() throws BException {
    final Start rootNode = parseInput("machine Test\nvariant y-x\nend", false);
    final AMachineParseUnit parseUnit = (AMachineParseUnit) rootNode.getPParseUnit();
    final AVariant variantClause = (AVariant) parseUnit.getVariant();
    assertEquals("y-x", variantClause.getExpression().getText());
}
Also used : Start(de.be4.eventbalg.core.parser.node.Start) AVariant(de.be4.eventbalg.core.parser.node.AVariant) AMachineParseUnit(de.be4.eventbalg.core.parser.node.AMachineParseUnit) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 AMachineParseUnit (de.be4.eventb.core.parser.node.AMachineParseUnit)1 AVariant (de.be4.eventb.core.parser.node.AVariant)1 Start (de.be4.eventb.core.parser.node.Start)1 AMachineParseUnit (de.be4.eventbalg.core.parser.node.AMachineParseUnit)1 AVariant (de.be4.eventbalg.core.parser.node.AVariant)1 Start (de.be4.eventbalg.core.parser.node.Start)1