]> source.dussan.org Git - poi.git/commitdiff
Add test for bug #43623, currently disabled as it makes FormulaParser unhappy
authorNick Burch <nick@apache.org>
Thu, 10 Jul 2008 21:03:52 +0000 (21:03 +0000)
committerNick Burch <nick@apache.org>
Thu, 10 Jul 2008 21:03:52 +0000 (21:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@675734 13f79535-47bb-0310-9956-ffa450edef68

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

index 115efc808b71a888dda7119893184bee102d8fd2..fde53ba6a3877904ce94e225422fb96f72d34b99 100644 (file)
@@ -1235,10 +1235,41 @@ public final class TestBugs extends TestCase {
     }
     
     /**
-     * Problem with "Vector Rows"
-     * @throws Exception
+     * Problem with "Vector Rows", eg a whole
+     *  column which is set to the result of
+     *  {=sin(B1:B9)}(9,1), so that each cell is
+     *  shown to have the contents
+     *  {=sin(B1:B9){9,1)[rownum][0]
+     * In this sample file, the vector column
+     *  is C, and the data column is B.
+     *  
+     * For now, blows up with an exception from ExtPtg
+     *  Expected ExpPtg to be converted from Shared to Non-Shared...
      */
-    public void test43623() throws Exception {
-       
+    public void DISABLEDtest43623() throws Exception {
+        HSSFWorkbook wb = openSample("43623.xls");
+        assertEquals(1, wb.getNumberOfSheets());
+        
+        HSSFSheet s1 = wb.getSheetAt(0);
+        
+        HSSFCell c1 = s1.getRow(0).getCell(2);
+        HSSFCell c2 = s1.getRow(1).getCell(2);
+        HSSFCell c3 = s1.getRow(2).getCell(2);
+        
+        // These formula contents are a guess...
+        assertEquals("{=sin(B1:B9){9,1)[0][0]", c1.getCellFormula());
+        assertEquals("{=sin(B1:B9){9,1)[1][0]", c2.getCellFormula());
+        assertEquals("{=sin(B1:B9){9,1)[2][0]", c3.getCellFormula());
+        
+        // Save and re-open, ensure it still works
+       HSSFWorkbook nwb = writeOutAndReadBack(wb);
+       HSSFSheet ns1 = nwb.getSheetAt(0);
+        HSSFCell nc1 = ns1.getRow(0).getCell(2);
+        HSSFCell nc2 = ns1.getRow(1).getCell(2);
+        HSSFCell nc3 = ns1.getRow(2).getCell(2);
+        
+        assertEquals("{=sin(B1:B9){9,1)[0][0]", nc1.getCellFormula());
+        assertEquals("{=sin(B1:B9){9,1)[1][0]", nc2.getCellFormula());
+        assertEquals("{=sin(B1:B9){9,1)[2][0]", nc3.getCellFormula());
     }
 }