Bug fix: expected error result now happens sooner

This commit is contained in:
Chris Hennick 2024-03-11 13:32:58 -07:00
parent 818a1cc5bb
commit 6d8de51bea

View file

@ -1403,11 +1403,9 @@ mod test {
#[cfg(feature = "deflate64")] #[cfg(feature = "deflate64")]
#[test] #[test]
fn deflate64_not_enough_space() -> std::io::Result<()> { fn deflate64_not_enough_space() {
let mut v = Vec::new(); let mut v = Vec::new();
v.extend_from_slice(include_bytes!("../tests/data/deflate64_issue_25.zip")); v.extend_from_slice(include_bytes!("../tests/data/deflate64_issue_25.zip"));
let mut reader = ZipArchive::new(Cursor::new(v))?; ZipArchive::new(Cursor::new(v)).expect_err("Invalid file");
std::io::copy(&mut reader.by_index(0)?, &mut std::io::sink()).expect_err("Invalid file");
Ok(())
} }
} }