From ae7c94b6cb95fac0d87ab3f7d9faea3c472f52d8 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Thu, 10 Jul 2008 21:03:52 +0000 Subject: [PATCH] Add test for bug #43623, currently disabled as it makes FormulaParser unhappy git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@675734 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/hssf/usermodel/TestBugs.java | 39 +++++++++++++++++-- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java index 115efc808b..fde53ba6a3 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java @@ -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()); } } -- 2.39.5