add test case

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1919064 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2024-07-09 14:16:47 +00:00
parent c1d6d0d4a1
commit bfd4645a72
3 changed files with 10 additions and 0 deletions

View File

@ -99,6 +99,7 @@ public class TestAllFiles {
// corrupt file
"spreadsheet/duplicate-filename.xlsx",
"spreadsheet/duplicate-filename-case-insensitive.xlsx",
"document/clusterfuzz-testcase-minimized-POIXWPFFuzzer-5166796835258368.docx",
};

View File

@ -1475,6 +1475,15 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
});
}
@Test
void testDuplicateFileCaseInsensitiveReadAsStream() {
assertThrows(InvalidZipException.class, () -> {
try (XSSFWorkbook wb = new XSSFWorkbook(openSampleFileStream("duplicate-filename-case-insensitive.xlsx"))) {
// expect exception here
}
});
}
@Test
void testWorkbookCloseClosesInputStream() throws Exception {
try (TrackingInputStream stream = new TrackingInputStream(