}
@Test
@SuppressWarnings("unchecked")
public void testEvaluate() throws Exception {
FunctionIdent ident = new FunctionIdent(ToIntFunction.NAME, ImmutableList.<DataType>of(DataTypes.STRING));
Scalar<Object, Object> format = (Scalar<Object, Object>) functions.get(ident);
Input<Object> arg1 = new Input<Object>() {
@Override
public Object value() {
return "123";
}
};
Object result = format.evaluate(arg1);
assertThat((Integer)result, is(123));
ident = new FunctionIdent(ToIntFunction.NAME, ImmutableList.<DataType>of(DataTypes.FLOAT));
format = (Scalar<Object, Object>) functions.get(ident);
arg1 = new Input<Object>() {
@Override
public Object value() {
return 42.5f;