Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1919064 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
pjfanning committed Jul 9, 2024
1 parent c1d6d0d commit bfd4645
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1475,6 +1475,15 @@ void testDuplicateFileReadAsStream() {
});
}

@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(
Expand Down
Binary file not shown.

0 comments on commit bfd4645

Please sign in to comment.