Search in sources :

Example 1 with BetweenNode

use of org.kie.dmn.feel.lang.ast.BetweenNode in project drools by kiegroup.

the class FEELParserTest method testBetween.

@Test
public void testBetween() {
    String inputExpression = "x between 10+y and 3**z";
    BaseNode between = parse(inputExpression);
    assertThat(between, is(instanceOf(BetweenNode.class)));
    assertThat(between.getResultType(), is(BuiltInType.BOOLEAN));
    assertThat(between.getText(), is(inputExpression));
    BetweenNode btw = (BetweenNode) between;
    assertThat(btw.getValue(), is(instanceOf(NameRefNode.class)));
    assertThat(btw.getValue().getText(), is("x"));
    assertThat(btw.getStart(), is(instanceOf(InfixOpNode.class)));
    assertThat(btw.getStart().getText(), is("10+y"));
    assertThat(btw.getEnd(), is(instanceOf(InfixOpNode.class)));
    assertThat(btw.getEnd().getText(), is("3**z"));
}
Also used : BetweenNode(org.kie.dmn.feel.lang.ast.BetweenNode) BaseNode(org.kie.dmn.feel.lang.ast.BaseNode) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 BaseNode (org.kie.dmn.feel.lang.ast.BaseNode)1 BetweenNode (org.kie.dmn.feel.lang.ast.BetweenNode)1