diff options
author | Nick Burch <nick@apache.org> | 2008-03-13 15:58:34 +0000 |
---|---|---|
committer | Nick Burch <nick@apache.org> | 2008-03-13 15:58:34 +0000 |
commit | 3a656eebb9642b36df88d59a01715c60f586395d (patch) | |
tree | 676bfffe6b9e28e799225b3f26fab25b0aa691a3 /src | |
parent | 91fe555a35b3a0e7258b1c5ffdf7415cf0836b0f (diff) | |
download | poi-3a656eebb9642b36df88d59a01715c60f586395d.tar.gz poi-3a656eebb9642b36df88d59a01715c60f586395d.zip |
Add test to show that bug #28031 is really closed
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@636790 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java index a1c28fa59e..f06f591c42 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java @@ -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"); |