File tree 2 files changed +14
-7
lines changed 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -91,15 +91,20 @@ macro_rules! util_name {
91
91
92
92
#[ macro_export]
93
93
macro_rules! new_cli {
94
- ( ) => { {
95
- use std:: env;
96
- let mut fixture_path = env:: current_dir( ) . unwrap( ) ;
97
- fixture_path. push( "tests" ) ;
98
- fixture_path. push( "fixtures" ) ;
99
- fixture_path. push( util_name!( ) ) ;
94
+ ( ) => {
100
95
assert_cli:: Assert :: main_binary( )
101
96
. with_args( & [ util_name!( ) ] )
102
- . current_dir( fixture_path)
97
+ } ;
98
+ }
99
+
100
+ #[ macro_export]
101
+ macro_rules! fixtures_path {
102
+ ( ) => { {
103
+ use std:: env;
104
+ let mut path = env:: current_dir( ) . unwrap( ) ;
105
+ path. push( "tests/fixtures" ) ;
106
+ path. push( util_name!( ) ) ;
107
+ path
103
108
} } ;
104
109
}
105
110
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ use assert_cli;
36
36
#[ test]
37
37
fn test_output_multi_files_print_all_chars ( ) {
38
38
new_cli ! ( )
39
+ . current_dir ( fixtures_path ! ( ) )
39
40
. with_args ( & [ "alpha.txt" , "256.txt" , "-A" , "-n" ] )
40
41
. succeeds ( )
41
42
. and ( )
@@ -57,6 +58,7 @@ fn test_output_multi_files_print_all_chars() {
57
58
#[ test]
58
59
fn test_numbered_lines_no_trailing_newline ( ) {
59
60
new_cli ! ( )
61
+ . current_dir ( fixtures_path ! ( ) )
60
62
. with_args ( & [ "nonewline.txt" , "alpha.txt" , "-n" ] )
61
63
. succeeds ( )
62
64
. and ( )
You can’t perform that action at this time.
0 commit comments