From: PJ Fanning Date: Fri, 27 Jul 2018 21:00:36 +0000 (+0000) Subject: add test case X-Git-Tag: REL_4_0_0_FINAL~64 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=07ee945a8295007cd1550e192ecf9ed8bcae4b20;p=poi.git add test case git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1836856 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java index 63a6e3ab41..cd10486626 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java @@ -24,13 +24,7 @@ import java.util.HashMap; import java.util.Map; import org.apache.poi.hssf.HSSFTestDataSamples; -import org.apache.poi.ss.usermodel.BaseTestFormulaEvaluator; -import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.CellValue; -import org.apache.poi.ss.usermodel.FormulaEvaluator; -import org.apache.poi.ss.usermodel.Row; -import org.apache.poi.ss.usermodel.Sheet; -import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.util.CellReference; import org.apache.poi.xssf.XSSFITestDataProvider; import org.apache.poi.xssf.XSSFTestDataSamples; @@ -442,4 +436,18 @@ public final class TestXSSFFormulaEvaluation extends BaseTestFormulaEvaluator { assertEquals("D 0,068", evaluator.evaluate(wb.getSheetAt(0).getRow(1).getCell(1))); } + + public void testBug62275() throws IOException { + try (Workbook wb = new XSSFWorkbook()) { + Sheet sheet = wb.createSheet(); + Row row = sheet.createRow(0); + + Cell cell = row.createCell(0); + cell.setCellFormula("vlookup(A2,B1:B5,2,)"); + + CreationHelper crateHelper = wb.getCreationHelper(); + FormulaEvaluator eval = crateHelper.createFormulaEvaluator(); + eval.evaluate(cell); + } + } }