File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,15 @@ use std::fs;
55use std:: io:: Write ;
66use std:: path:: { Path , PathBuf } ;
77
8+ fn sorted_entry_names ( dir : & Path ) -> Vec < String > {
9+ let mut names = fs:: read_dir ( dir)
10+ . unwrap ( )
11+ . map ( |entry| entry. unwrap ( ) . file_name ( ) . into_string ( ) . unwrap ( ) )
12+ . collect :: < Vec < _ > > ( ) ;
13+ names. sort ( ) ;
14+ names
15+ }
16+
817fn build_archive_with_file ( archive_path : & Path , file_name : & str , file_content : & [ u8 ] ) {
918 if let Some ( parent) = archive_path. parent ( ) {
1019 fs:: create_dir_all ( parent) . unwrap ( ) ;
@@ -566,7 +575,7 @@ fn stdio_extract_rewrites_windows_drive_prefixed_entry_name() {
566575 . success ( ) ;
567576
568577 assert ! ( out_dir. join( "file04" ) . exists( ) ) ;
569- assert ! ( !out_dir . join ( "c:" ) . exists ( ) ) ;
578+ assert_eq ! ( sorted_entry_names ( & out_dir ) , vec! [ "file04" ] ) ;
570579}
571580
572581/// Precondition: Archive contains a file whose entry name uses a Windows UNC API prefix.
You can’t perform that action at this time.
0 commit comments