]> source.dussan.org Git - poi.git/commitdiff
add test case
authorPJ Fanning <fanningpj@apache.org>
Fri, 27 Jul 2018 21:00:36 +0000 (21:00 +0000)
committerPJ Fanning <fanningpj@apache.org>
Fri, 27 Jul 2018 21:00:36 +0000 (21:00 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1836856 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java

index 63a6e3ab41f6f664938bbd199983f59aa5118a7c..cd1048662672907edbe0fbd8570f9585cae83760 100644 (file)
@@ -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);
+        }
+    }
 }