Search in sources :

Example 6 with ASTNode

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

the class FEELParserSeverityTest method testUnexistentOperatorInvokeLTLT.

@Test
public void testUnexistentOperatorInvokeLTLT() {
    // RHDM-1119
    String inputExpression = "{ m: <<18 }.m(16)";
    ASTNode number = parseSeverity(inputExpression, FEELEvent.Severity.WARN);
    assertThat(number, is(instanceOf(FunctionInvocationNode.class)));
    assertThat(number.getResultType(), is(instanceOf(Type.class)));
    assertLocation(inputExpression, number);
}
Also used : ASTNode(org.kie.dmn.feel.lang.ast.ASTNode) Test(org.junit.Test)

Example 7 with ASTNode

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

the class FEELParserSeverityTest method testUnexistentOperatorGTGTGT.

@Test
public void testUnexistentOperatorGTGTGT() {
    // RHDM-1119
    String inputExpression = "1 >>> 2";
    ASTNode number = parseSeverity(inputExpression, FEELEvent.Severity.WARN);
    assertThat(number, is(instanceOf(InfixOpNode.class)));
    assertThat(number.getResultType(), is(BuiltInType.BOOLEAN));
    assertLocation(inputExpression, number);
}
Also used : ASTNode(org.kie.dmn.feel.lang.ast.ASTNode) Test(org.junit.Test)

Example 8 with ASTNode

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

the class FEELParserSeverityTest method testUnexistentOperatorEQEQ.

@Test
public void testUnexistentOperatorEQEQ() {
    // RHDM-1119
    String inputExpression = "1 == 2";
    ASTNode number = parseSeverity(inputExpression, FEELEvent.Severity.WARN);
    assertThat(number, is(instanceOf(InfixOpNode.class)));
    assertThat(number.getResultType(), is(BuiltInType.BOOLEAN));
    assertLocation(inputExpression, number);
}
Also used : ASTNode(org.kie.dmn.feel.lang.ast.ASTNode) Test(org.junit.Test)

Aggregations

ASTNode (org.kie.dmn.feel.lang.ast.ASTNode)8 Test (org.junit.Test)6 CompiledExpression (org.kie.dmn.feel.lang.CompiledExpression)2 CompilerContext (org.kie.dmn.feel.lang.CompilerContext)2 FunctionInvocationNode (org.kie.dmn.feel.lang.ast.FunctionInvocationNode)2