use of com.dexels.navajo.expression.api.ContextExpression in project navajo by Dexels.
the class TestCompiledExpression method testFunctionParamTypeError.
@Test
public void testFunctionParamTypeError() throws TMLExpressionException {
List<String> problems = new ArrayList<>();
ContextExpression o = ExpressionCache.getInstance().parse(problems, "ToUpper(1)", name -> FunctionClassification.DEFAULT);
System.err.println("problems: " + problems);
System.err.println("returntype: " + o.returnType());
System.err.println("immutable: " + o.isLiteral());
if (RuntimeConfig.STRICT_TYPECHECK.getValue() != null) {
Assert.assertEquals(1, problems.size());
} else {
Assert.assertEquals("Don't expect problems to appear when STRICT_TYPECHECK is false", 0, problems.size());
// Assert.fail("Failed test, ony valid when STRICT_TYPECHECK. Set env for unit tests.");
}
}
Aggregations