This commit is contained in:
Chris Hennick 2023-05-04 16:35:04 -07:00
parent b1ac3912db
commit 44d179355c
No known key found for this signature in database
GPG key ID: 25653935CC8B6C74

View file

@ -1600,6 +1600,11 @@ mod test {
writer
.shallow_copy_file(RT_TEST_FILENAME, SECOND_FILENAME)
.unwrap();
writer
.shallow_copy_file(RT_TEST_FILENAME, SECOND_FILENAME)
.expect_err("Duplicate filename");
let zip = writer.finish().unwrap();
let mut writer = ZipWriter::new_append(zip).unwrap();
writer
.shallow_copy_file(SECOND_FILENAME, SECOND_FILENAME)
.expect_err("Duplicate filename");
@ -1643,7 +1648,9 @@ mod test {
.unwrap();
let zip = writer.finish().unwrap();
let mut writer = ZipWriter::new_append(zip).unwrap();
writer.deep_copy_file(RT_TEST_FILENAME, THIRD_FILENAME).unwrap();
writer
.deep_copy_file(RT_TEST_FILENAME, THIRD_FILENAME)
.unwrap();
let zip = writer.finish().unwrap();
let mut reader = ZipArchive::new(zip).unwrap();
let mut file_names: Vec<&str> = reader.file_names().collect();