Search in sources :

Example 1 with APartitionPredicate

use of de.be4.classicalb.core.parser.node.APartitionPredicate in project probparsers by bendisposto.

the class ASTPrologTest method testPartition.

@Test
public void testPartition() {
    final PExpression set = createId("set");
    final PExpression one = new AIntegerExpression(new TIntegerLiteral("1"));
    final PExpression two = new AIntegerExpression(new TIntegerLiteral("2"));
    final PExpression three = new AIntegerExpression(new TIntegerLiteral("3"));
    final APartitionPredicate pred = new APartitionPredicate(set, Arrays.asList(one, two, three));
    final String expected = "partition($,identifier($,set),[integer($,1),integer($,2),integer($,3)])";
    checkAST(0, expected, pred);
}
Also used : AIntegerExpression(de.be4.classicalb.core.parser.node.AIntegerExpression) APartitionPredicate(de.be4.classicalb.core.parser.node.APartitionPredicate) TIntegerLiteral(de.be4.classicalb.core.parser.node.TIntegerLiteral) PExpression(de.be4.classicalb.core.parser.node.PExpression) Test(org.junit.Test)

Aggregations

AIntegerExpression (de.be4.classicalb.core.parser.node.AIntegerExpression)1 APartitionPredicate (de.be4.classicalb.core.parser.node.APartitionPredicate)1 PExpression (de.be4.classicalb.core.parser.node.PExpression)1 TIntegerLiteral (de.be4.classicalb.core.parser.node.TIntegerLiteral)1 Test (org.junit.Test)1