File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -26,22 +26,26 @@ fn unknown_param() -> Result<(), Box<dyn std::error::Error>> {
26
26
fn cannot_read_files ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
27
27
let file = NamedTempFile :: new ( ) ?;
28
28
29
+ let nofile = NamedTempFile :: new ( ) ?;
30
+ let nopath = nofile. into_temp_path ( ) ;
31
+ std:: fs:: remove_file ( & nopath) ?;
32
+
29
33
let mut cmd = Command :: cargo_bin ( "diffutils" ) ?;
30
- cmd. arg ( "foo.txt" ) . arg ( file. path ( ) ) ;
34
+ cmd. arg ( & nopath ) . arg ( file. path ( ) ) ;
31
35
cmd. assert ( )
32
36
. code ( predicate:: eq ( 2 ) )
33
37
. failure ( )
34
38
. stderr ( predicate:: str:: starts_with ( "Failed to read from-file" ) ) ;
35
39
36
40
let mut cmd = Command :: cargo_bin ( "diffutils" ) ?;
37
- cmd. arg ( file. path ( ) ) . arg ( "foo.txt" ) ;
41
+ cmd. arg ( file. path ( ) ) . arg ( & nopath ) ;
38
42
cmd. assert ( )
39
43
. code ( predicate:: eq ( 2 ) )
40
44
. failure ( )
41
45
. stderr ( predicate:: str:: starts_with ( "Failed to read to-file" ) ) ;
42
46
43
47
let mut cmd = Command :: cargo_bin ( "diffutils" ) ?;
44
- cmd. arg ( "foo.txt" ) . arg ( "foo.txt" ) ;
48
+ cmd. arg ( & nopath ) . arg ( & nopath ) ;
45
49
cmd. assert ( )
46
50
. code ( predicate:: eq ( 2 ) )
47
51
. failure ( )
You can’t perform that action at this time.
0 commit comments