From 3b3b63cef5444b8991c1cb906bb8fbb2fe539f05 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Sun, 23 Apr 2023 15:14:44 -0700 Subject: [PATCH] Fix a flaky test --- src/write.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/write.rs b/src/write.rs index da1cc86f..ac07a49c 100644 --- a/src/write.rs +++ b/src/write.rs @@ -1492,8 +1492,11 @@ mod test { .unwrap(); let zip = writer.finish().unwrap(); let mut reader = ZipArchive::new(zip).unwrap(); - let file_names: Vec<&str> = reader.file_names().collect(); - assert_eq!(file_names, vec![RT_TEST_FILENAME, SECOND_FILENAME]); + let mut file_names: Vec<&str> = reader.file_names().collect(); + file_names.sort(); + let mut expected_file_names = vec![RT_TEST_FILENAME, SECOND_FILENAME]; + expected_file_names.sort(); + assert_eq!(file_names, expected_file_names); let mut first_file_content = String::new(); reader .by_name(RT_TEST_FILENAME)