ValueEval[] values = {
new NumberEval(25.0),
new NumberEval(26.0),
new NumberEval(28.0),
};
AreaEval arg0 = EvalFactory.createAreaEval("A10:C10", values);
ValueEval[] args = new ValueEval[] { arg0, MissingArgEval.instance, new NumberEval(2), };
ValueEval actualResult;
try {
actualResult = FUNC_INST.evaluate(args, -1, -1);
} catch (RuntimeException e) {
if (e.getMessage().equals("Unexpected arg eval type (org.apache.poi.hssf.record.formula.eval.MissingArgEval")) {
throw new AssertionFailedError("Identified bug 47048b - INDEX() should support missing-arg");
}
throw e;
}
// result should be an area eval "B10:B10"
AreaEval ae = confirmAreaEval("B10:B10", actualResult);
actualResult = ae.getValue(0, 0);
assertEquals(NumberEval.class, actualResult.getClass());
assertEquals(26.0, ((NumberEval)actualResult).getNumberValue(), 0.0);
}