Unit test to show that bug #52111 (intersect formulas) was already solved
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1613737 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5d9f8945c9
commit
a4e73e3dc8
@ -2702,4 +2702,24 @@ public final class TestBugs extends BaseTestBugzillaIssues {
|
|||||||
// Optimise
|
// Optimise
|
||||||
HSSFOptimiser.optimiseCellStyles(workbook);
|
HSSFOptimiser.optimiseCellStyles(workbook);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Intersection formula ranges, eg =(C2:D3 D3:E4)
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void bug52111() throws Exception {
|
||||||
|
Workbook wb = openSample("Intersection-52111.xls");
|
||||||
|
Sheet s = wb.getSheetAt(0);
|
||||||
|
|
||||||
|
// Check we can read it correctly
|
||||||
|
Cell intF = s.getRow(2).getCell(0);
|
||||||
|
assertEquals(Cell.CELL_TYPE_FORMULA, intF.getCellType());
|
||||||
|
assertEquals(Cell.CELL_TYPE_NUMERIC, intF.getCachedFormulaResultType());
|
||||||
|
|
||||||
|
assertEquals("(C2:D3 D3:E4)", intF.getCellFormula());
|
||||||
|
|
||||||
|
// Check we can evaluate it correctly
|
||||||
|
FormulaEvaluator eval = wb.getCreationHelper().createFormulaEvaluator();
|
||||||
|
assertEquals("4.0", eval.evaluate(intF).formatAsString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
BIN
test-data/spreadsheet/Intersection-52111.xls
Normal file
BIN
test-data/spreadsheet/Intersection-52111.xls
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user