@@ -407,11 +407,11 @@ mod tests {
407407 use super :: * ;
408408 use pretty_assertions:: assert_eq;
409409
410- use crate :: utils:: testcmds:: PATCH_CMD ;
410+ use uucore :: utils:: testcmds:: PATCH_CMD ;
411411
412412 #[ test]
413413 fn test_permutations ( ) {
414- let target = "target/unified-diff/" ;
414+ let target = "../../../ target/unified-diff/" ;
415415 // test all possible six-line files.
416416 let _ = std:: fs:: create_dir ( target) ;
417417 for & a in & [ 0 , 1 , 2 ] {
@@ -493,11 +493,12 @@ mod tests {
493493 . unwrap_or_else( |_| String :: from( "[Invalid UTF-8]" ) )
494494 ) ;
495495
496- use crate :: utils:: testcmds:: PATCH_CMD ;
496+ use uucore :: utils:: testcmds:: PATCH_CMD ;
497497
498498 let output = PATCH_CMD
499499 . new ( )
500- . arg ( "-p0" )
500+ . arg ( "-d" )
501+ . arg ( & format ! ( "{target}" ) )
501502 . stdin ( File :: open ( format ! ( "{target}/ab.diff" ) ) . unwrap ( ) )
502503 . output ( )
503504 . unwrap ( ) ;
@@ -516,7 +517,7 @@ mod tests {
516517
517518 #[ test]
518519 fn test_permutations_missing_line_ending ( ) {
519- let target = "target/unified-diff/" ;
520+ let target = "../../../ target/unified-diff/" ;
520521 // test all possible six-line files with missing newlines.
521522 let _ = std:: fs:: create_dir ( target) ;
522523 for & a in & [ 0 , 1 , 2 ] {
@@ -598,7 +599,8 @@ mod tests {
598599 let _ = fb;
599600 let output = PATCH_CMD
600601 . new ( )
601- . arg ( "-p0" )
602+ . arg ( "-d" )
603+ . arg ( & format ! ( "{target}" ) )
602604 . stdin ( File :: open ( format ! ( "{target}/abn.diff" ) ) . unwrap ( ) )
603605 . output ( )
604606 . unwrap ( ) ;
@@ -618,7 +620,7 @@ mod tests {
618620
619621 #[ test]
620622 fn test_permutations_empty_lines ( ) {
621- let target = "target/unified-diff/" ;
623+ let target = "../../../ target/unified-diff/" ;
622624 // test all possible six-line files with missing newlines.
623625 let _ = std:: fs:: create_dir ( target) ;
624626 for & a in & [ 0 , 1 , 2 ] {
@@ -695,7 +697,8 @@ mod tests {
695697 let _ = fb;
696698 let output = PATCH_CMD
697699 . new ( )
698- . arg ( "-p0" )
700+ . arg ( "-d" )
701+ . arg ( & format ! ( "{target}" ) )
699702 . stdin ( File :: open ( format ! ( "{target}/ab_.diff" ) ) . unwrap ( ) )
700703 . output ( )
701704 . unwrap ( ) ;
@@ -715,7 +718,7 @@ mod tests {
715718
716719 #[ test]
717720 fn test_permutations_missing_lines ( ) {
718- let target = "target/unified-diff/" ;
721+ let target = "../../../ target/unified-diff/" ;
719722 // test all possible six-line files.
720723 let _ = std:: fs:: create_dir ( target) ;
721724 for & a in & [ 0 , 1 , 2 ] {
@@ -777,7 +780,8 @@ mod tests {
777780 let _ = fb;
778781 let output = PATCH_CMD
779782 . new ( )
780- . arg ( "-p0" )
783+ . arg ( "-d" )
784+ . arg ( & format ! ( "{target}" ) )
781785 . stdin ( File :: open ( format ! ( "{target}/abx.diff" ) ) . unwrap ( ) )
782786 . output ( )
783787 . unwrap ( ) ;
@@ -796,7 +800,7 @@ mod tests {
796800
797801 #[ test]
798802 fn test_permutations_reverse ( ) {
799- let target = "target/unified-diff/" ;
803+ let target = "../../../ target/unified-diff/" ;
800804 // test all possible six-line files.
801805 let _ = std:: fs:: create_dir ( target) ;
802806 for & a in & [ 0 , 1 , 2 ] {
@@ -864,7 +868,8 @@ mod tests {
864868 let _ = fb;
865869 let output = PATCH_CMD
866870 . new ( )
867- . arg ( "-p0" )
871+ . arg ( "-d" )
872+ . arg ( & format ! ( "{target}" ) )
868873 . stdin ( File :: open ( format ! ( "{target}/abr.diff" ) ) . unwrap ( ) )
869874 . output ( )
870875 . unwrap ( ) ;
@@ -883,7 +888,7 @@ mod tests {
883888
884889 #[ test]
885890 fn test_stop_early ( ) {
886- use crate :: assert_diff_eq;
891+ use uucore :: assert_diff_eq;
887892
888893 let from_filename = "foo" ;
889894 let from = [ "a" , "b" , "c" , "" ] . join ( "\n " ) ;
0 commit comments