]> source.dussan.org Git - poi.git/commitdiff
[bug-66181] test case
authorPJ Fanning <fanningpj@apache.org>
Mon, 1 Aug 2022 15:57:58 +0000 (15:57 +0000)
committerPJ Fanning <fanningpj@apache.org>
Mon, 1 Aug 2022 15:57:58 +0000 (15:57 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1903170 13f79535-47bb-0310-9956-ffa450edef68

poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFBugs.java

index 26011c37111ef935ea80c021f9857046bcbc110d..1d6cac19b44d2c8f4cc5ea334937b1a5b50ea0d9 100644 (file)
@@ -3686,4 +3686,23 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
             }
         }
     }
+
+    @Test
+    void testBug66181() throws IOException {
+        File file = XSSFTestDataSamples.getSampleFile("ValueFunctionOfBlank.xlsx");
+        try (
+                FileInputStream fis = new FileInputStream(file);
+                Workbook workbook = WorkbookFactory.create(fis)
+        ) {
+            Sheet sheet = workbook.getSheetAt(0);
+            Row row = sheet.getRow(0);
+            Cell a1 = row.getCell(0);
+            assertEquals(CellType.FORMULA, a1.getCellType());
+            assertEquals(CellType.ERROR, a1.getCachedFormulaResultType());
+            FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();
+            CellValue cv1 = evaluator.evaluate(a1);
+            //this next line should probably return CellType.ERROR
+            assertEquals(CellType.NUMERIC, cv1.getCellType());
+        }
+    }
 }
\ No newline at end of file