mirror of https://github.com/apache/poi.git
add data-formatter test
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1895706 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ea9883af55
commit
a24820e629
|
@ -107,4 +107,17 @@ public final class TestXSSFDataFormat extends BaseTestDataFormat {
|
||||||
assertEquals("1000", formatter.formatCellValue(cell, evaluator));
|
assertEquals("1000", formatter.formatCellValue(cell, evaluator));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testSetUseCachedValuesForFormulaCells() throws Exception {
|
||||||
|
try (XSSFWorkbook wb = openSampleWorkbook("formula-eval.xlsx")) {
|
||||||
|
final DataFormatter formatter = new DataFormatter();
|
||||||
|
XSSFSheet sheet = wb.getSheetAt(0);
|
||||||
|
XSSFRow row = sheet.getRow(0);
|
||||||
|
XSSFCell d1 = row.getCell(3);
|
||||||
|
assertEquals("SUM(A1:C1)", formatter.formatCellValue(d1));
|
||||||
|
formatter.setUseCachedValuesForFormulaCells(true);
|
||||||
|
assertEquals("6.75", formatter.formatCellValue(d1));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue