Perform copy earlier, to catch recent bug

This commit is contained in:
Chris Hennick 2023-04-29 17:54:31 -07:00
parent 6b4a07f2a7
commit ed5c76d2e8
No known key found for this signature in database
GPG key ID: 25653935CC8B6C74

View file

@ -103,6 +103,17 @@ fn write_test_archive(file: &mut Cursor<Vec<u8>>, method: CompressionMethod, sha
.compression_method(method) .compression_method(method)
.unix_permissions(0o755); .unix_permissions(0o755);
zip.start_file(ENTRY_NAME, options).unwrap();
zip.write_all(LOREM_IPSUM).unwrap();
if shallow_copy {
zip.shallow_copy_file(ENTRY_NAME, INTERNAL_COPY_ENTRY_NAME)
.unwrap();
} else {
zip.deep_copy_file(ENTRY_NAME, INTERNAL_COPY_ENTRY_NAME)
.unwrap();
}
zip.start_file("test/☃.txt", options).unwrap(); zip.start_file("test/☃.txt", options).unwrap();
zip.write_all(b"Hello, World!\n").unwrap(); zip.write_all(b"Hello, World!\n").unwrap();
@ -115,17 +126,6 @@ fn write_test_archive(file: &mut Cursor<Vec<u8>>, method: CompressionMethod, sha
zip.end_extra_data().unwrap(); zip.end_extra_data().unwrap();
zip.write_all(b"Hello, World! Again.\n").unwrap(); zip.write_all(b"Hello, World! Again.\n").unwrap();
zip.start_file(ENTRY_NAME, options).unwrap();
zip.write_all(LOREM_IPSUM).unwrap();
if shallow_copy {
zip.shallow_copy_file(ENTRY_NAME, INTERNAL_COPY_ENTRY_NAME)
.unwrap();
} else {
zip.deep_copy_file(ENTRY_NAME, INTERNAL_COPY_ENTRY_NAME)
.unwrap();
}
zip.finish().unwrap(); zip.finish().unwrap();
} }