File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 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>> {
2626fn cannot_read_files ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
2727 let file = NamedTempFile :: new ( ) ?;
2828
29+ let nofile = NamedTempFile :: new ( ) ?;
30+ let nopath = nofile. into_temp_path ( ) ;
31+ std:: fs:: remove_file ( & nopath) ?;
32+
2933 let mut cmd = Command :: cargo_bin ( "diffutils" ) ?;
30- cmd. arg ( "foo.txt" ) . arg ( file. path ( ) ) ;
34+ cmd. arg ( & nopath ) . arg ( file. path ( ) ) ;
3135 cmd. assert ( )
3236 . code ( predicate:: eq ( 2 ) )
3337 . failure ( )
3438 . stderr ( predicate:: str:: starts_with ( "Failed to read from-file" ) ) ;
3539
3640 let mut cmd = Command :: cargo_bin ( "diffutils" ) ?;
37- cmd. arg ( file. path ( ) ) . arg ( "foo.txt" ) ;
41+ cmd. arg ( file. path ( ) ) . arg ( & nopath ) ;
3842 cmd. assert ( )
3943 . code ( predicate:: eq ( 2 ) )
4044 . failure ( )
4145 . stderr ( predicate:: str:: starts_with ( "Failed to read to-file" ) ) ;
4246
4347 let mut cmd = Command :: cargo_bin ( "diffutils" ) ?;
44- cmd. arg ( "foo.txt" ) . arg ( "foo.txt" ) ;
48+ cmd. arg ( & nopath ) . arg ( & nopath ) ;
4549 cmd. assert ( )
4650 . code ( predicate:: eq ( 2 ) )
4751 . failure ( )
You can’t perform that action at this time.
0 commit comments