From f3a1d6ac92be74c9d79809a9bf478a9c6c3c08cb Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Mon, 1 Aug 2022 15:57:58 +0000 Subject: [PATCH] [bug-66181] test case git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1903170 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/xssf/usermodel/TestXSSFBugs.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFBugs.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFBugs.java index 26011c3711..1d6cac19b4 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFBugs.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFBugs.java @@ -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 -- 2.39.5