From ed5c76d2e87b8649df481d4e1ba4df87f4ec84bb Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Sat, 29 Apr 2023 17:54:31 -0700 Subject: [PATCH] Perform copy earlier, to catch recent bug --- tests/end_to_end.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/end_to_end.rs b/tests/end_to_end.rs index 57f7a8e7..047b5955 100644 --- a/tests/end_to_end.rs +++ b/tests/end_to_end.rs @@ -103,6 +103,17 @@ fn write_test_archive(file: &mut Cursor>, method: CompressionMethod, sha .compression_method(method) .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.write_all(b"Hello, World!\n").unwrap(); @@ -115,17 +126,6 @@ fn write_test_archive(file: &mut Cursor>, method: CompressionMethod, sha zip.end_extra_data().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(); }