add test for broken file (5.0.1-RC1 issues)

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1893442 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2021-09-19 12:45:26 +00:00
parent 61cd25f201
commit f591073698
2 changed files with 16 additions and 1 deletions

View File

@ -1191,6 +1191,21 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
}
}
@Test
void test501RC1Failure() throws Exception {
String filename = "0-www-crossref-org.lib.rivier.edu_education-files_suffix-generator.xlsm";
try(XSSFWorkbook workbook = openSampleWorkbook(filename)) {
for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
XSSFSheet sheet = workbook.getSheetAt(i);
for (Row row : sheet) {
for (Cell cell : row) {
assertNotNull(cell);
}
}
}
}
}
private static void expectFormattedContent(Cell cell, String value) {
assertEquals(value, new DataFormatter().formatCellValue(cell),
"Cell " + ref(cell) + " has wrong formatted content.");