]> source.dussan.org Git - poi.git/commitdiff
Add test to show that bug #28031 is really closed
authorNick Burch <nick@apache.org>
Thu, 13 Mar 2008 15:58:34 +0000 (15:58 +0000)
committerNick Burch <nick@apache.org>
Thu, 13 Mar 2008 15:58:34 +0000 (15:58 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@636790 13f79535-47bb-0310-9956-ffa450edef68

src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java

index a1c28fa59e391c6993e6aafaf5e8b1f837c91d55..f06f591c425241aaa0dc70bb12251b53e73b8324 100644 (file)
@@ -508,6 +508,30 @@ extends TestCase {
         }
         assertTrue("No Exceptions till here!", true);
     }
+
+       public void test28031() {
+        HSSFWorkbook wb = new HSSFWorkbook();
+        HSSFSheet sheet = wb.createSheet();
+        wb.setSheetName(0, "Sheet1");
+
+        HSSFRow row = sheet.createRow(0);
+        HSSFCell cell = row.createCell((short)0);
+        String formulaText =
+                       "IF(ROUND(A2*B2*C2,2)>ROUND(B2*D2,2),ROUND(A2*B2*C2,2),ROUND(B2*D2,2))";
+        cell.setCellFormula(formulaText);
+
+        assertEquals(formulaText, cell.getCellFormula());
+        if(false) {
+            // this file can be inspected manually
+            try {
+                OutputStream os = new FileOutputStream("/tmp/output28031.xls");
+                wb.write(os);
+                os.close();
+            } catch (IOException e) {
+                throw new RuntimeException(e);
+            }
+        }
+    }
        
        public void test33082() throws java.io.IOException {
               String filename = System.getProperty("HSSF.testdata.path");