File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -296,7 +296,7 @@ fn copy_direntry(
296296 if !source_is_dir {
297297 if let Err ( err) = copy_file (
298298 progress_bar,
299- & entry. source_absolute ,
299+ & entry. source_relative ,
300300 entry. local_to_target . as_path ( ) ,
301301 options,
302302 symlinked_files,
Original file line number Diff line number Diff line change @@ -7136,3 +7136,30 @@ fn test_cp_no_preserve_target_directory() {
71367136 assert ! ( at. file_exists( "e/f2" ) ) ;
71377137 assert ! ( at. file_exists( "e/f3" ) ) ;
71387138}
7139+
7140+ #[ test]
7141+ fn test_cp_recurse_verbose_output ( ) {
7142+ let source_dir = "source_dir" ;
7143+ let target_dir = "target_dir" ;
7144+ let file = "file" ;
7145+ #[ cfg( not( windows) ) ]
7146+ let output = format ! (
7147+ "'{source_dir}' -> '{target_dir}/'\n '{source_dir}/{file}' -> '{target_dir}/{file}'\n "
7148+ ) ;
7149+ #[ cfg( windows) ]
7150+ let output = format ! (
7151+ "'{source_dir}' -> '{target_dir}\\ '\n '{source_dir}\\ {file}' -> '{target_dir}\\ {file}'\n "
7152+ ) ;
7153+ let ( at, mut ucmd) = at_and_ucmd ! ( ) ;
7154+
7155+ at. mkdir ( source_dir) ;
7156+ at. touch ( format ! ( "{source_dir}/{file}" ) ) ;
7157+
7158+ ucmd. arg ( source_dir)
7159+ . arg ( target_dir)
7160+ . arg ( "-r" )
7161+ . arg ( "--verbose" )
7162+ . succeeds ( )
7163+ . no_stderr ( )
7164+ . stdout_is ( output) ;
7165+ }
You can’t perform that action at this time.
0 commit comments