use of com.yahoo.searchlib.rankingexpression.rule.FunctionNode in project vespa by vespa-engine.
the class RankingExpressionTestCase method testIsNan.
@Test
public void testIsNan() throws ParseException {
String strExpr = "if (isNan(attribute(foo)) == 1.0, 1.0, attribute(foo))";
RankingExpression expr = new RankingExpression(strExpr);
CompositeNode root = (CompositeNode) expr.getRoot();
CompositeNode comparison = (CompositeNode) root.children().get(0);
ExpressionNode isNan = comparison.children().get(0);
assertTrue(isNan instanceof FunctionNode);
assertEquals("isNan(attribute(foo))", isNan.toString());
}
Aggregations