]> source.dussan.org Git - poi.git/commitdiff
Further unit tests for #55747
authorNick Burch <nick@apache.org>
Sat, 1 Aug 2015 00:01:56 +0000 (00:01 +0000)
committerNick Burch <nick@apache.org>
Sat, 1 Aug 2015 00:01:56 +0000 (00:01 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1693675 13f79535-47bb-0310-9956-ffa450edef68

src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java

index 9161b0a98f1dded54ae55e41b56069540dbdc09e..83450e45d4b681552ca59127ccb167e6133f932b 100644 (file)
@@ -37,7 +37,6 @@ import org.apache.poi.ss.ITestDataProvider;
 import org.apache.poi.ss.SpreadsheetVersion;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.ss.util.SheetUtil;
-import org.apache.poi.util.StringUtil;
 import org.junit.Assume;
 import org.junit.Ignore;
 import org.junit.Test;
@@ -1150,5 +1149,27 @@ public abstract class BaseTestBugzillaIssues {
         cell.setCellFormula("IF(A1<>\"\",IF(C1<>\"\",MID(A1,1,2),\"c1\"),\"c2\")");
         ev.evaluateAll();
         assertEquals("ab", cell.getStringCellValue());
+        
+        // Write it back out, and re-read
+        wb = _testDataProvider.writeOutAndReadBack(wb);
+        ev = wb.getCreationHelper().createFormulaEvaluator();
+        s = wb.getSheetAt(0);
+        row = s.getRow(0);
+        
+        // Check read ok, and re-evaluate fine
+        cell = row.getCell(5);
+        assertEquals("ab", cell.getStringCellValue());
+        ev.evaluateFormulaCell(cell);
+        assertEquals("ab", cell.getStringCellValue());
+        
+        cell = row.getCell(6);
+        assertEquals("empty", cell.getStringCellValue());
+        ev.evaluateFormulaCell(cell);
+        assertEquals("empty", cell.getStringCellValue());
+        
+        cell = row.getCell(7);
+        assertEquals("ab", cell.getStringCellValue());
+        ev.evaluateFormulaCell(cell);
+        assertEquals("ab", cell.getStringCellValue());
     }
 }