@@ -116,15 +116,25 @@ fn existing() {
116116fn  invalid_characters ( )  { 
117117    cargo_process ( "new foo.rs" ) 
118118        . with_status ( 101 ) 
119-         . with_stderr ( "[ERROR] invalid character `.` in crate name: `foo.rs`, [..]" ) 
119+         . with_stderr ( 
120+             "\  
121+  [ERROR] invalid character `.` in crate name: `foo.rs`, [..]
122+ If you need a crate name to not match the directory name, consider using --name flag. 
123+ " , 
124+         ) 
120125        . run ( ) ; 
121126} 
122127
123128#[ cargo_test]  
124129fn  reserved_name ( )  { 
125130    cargo_process ( "new test" ) 
126131        . with_status ( 101 ) 
127-         . with_stderr ( "[ERROR] the name `test` cannot be used as a crate name, it conflicts [..]" ) 
132+         . with_stderr ( 
133+             "\  
134+  [ERROR] the name `test` cannot be used as a crate name, it conflicts [..]
135+ If you need a crate name to not match the directory name, consider using --name flag. 
136+ " , 
137+         ) 
128138        . run ( ) ; 
129139} 
130140
@@ -133,7 +143,10 @@ fn reserved_binary_name() {
133143    cargo_process ( "new --bin incremental" ) 
134144        . with_status ( 101 ) 
135145        . with_stderr ( 
136-             "[ERROR] the name `incremental` cannot be used as a crate name, it conflicts [..]" , 
146+             "\  
147+  [ERROR] the name `incremental` cannot be used as a crate name, it conflicts [..]
148+ If you need a crate name to not match the directory name, consider using --name flag. 
149+ " , 
137150        ) 
138151        . run ( ) ; 
139152
@@ -153,7 +166,12 @@ it conflicts with cargo's build directory names
153166fn  keyword_name ( )  { 
154167    cargo_process ( "new pub" ) 
155168        . with_status ( 101 ) 
156-         . with_stderr ( "[ERROR] the name `pub` cannot be used as a crate name, it is a Rust keyword" ) 
169+         . with_stderr ( 
170+             "\  
171+  [ERROR] the name `pub` cannot be used as a crate name, it is a Rust keyword
172+ If you need a crate name to not match the directory name, consider using --name flag. 
173+ " , 
174+         ) 
157175        . run ( ) ; 
158176} 
159177
@@ -522,7 +540,12 @@ fn restricted_windows_name() {
522540        cargo_process ( "new nul" ) 
523541            . env ( "USER" ,  "foo" ) 
524542            . with_status ( 101 ) 
525-             . with_stderr ( "[ERROR] cannot use name `nul`, it is a reserved Windows filename" ) 
543+             . with_stderr ( 
544+                 "\  
545+  [ERROR] cannot use name `nul`, it is a reserved Windows filename
546+ If you need a crate name to not match the directory name, consider using --name flag. 
547+ " , 
548+             ) 
526549            . run ( ) ; 
527550    }  else  { 
528551        cargo_process ( "new nul" ) 
@@ -559,17 +582,23 @@ fn non_ascii_name_invalid() {
559582        . env ( "USER" ,  "foo" ) 
560583        . with_status ( 101 ) 
561584        . with_stderr ( 
562-             "[ERROR] invalid character `Ⓐ` in crate name: `ⒶⒷⒸ`, \  
563-              the first character must be a Unicode XID start character (most letters or `_`)", 
585+             "\  
586+  [ERROR] invalid character `Ⓐ` in crate name: `ⒶⒷⒸ`, \ 
587+  the first character must be a Unicode XID start character (most letters or `_`)
588+ If you need a crate name to not match the directory name, consider using --name flag. 
589+ " , 
564590        ) 
565591        . run ( ) ; 
566592
567593    cargo_process ( "new a¼" ) 
568594        . env ( "USER" ,  "foo" ) 
569595        . with_status ( 101 ) 
570596        . with_stderr ( 
571-             "[ERROR] invalid character `¼` in crate name: `a¼`, \  
572-              characters must be Unicode XID characters (numbers, `-`, `_`, or most letters)", 
597+             "\  
598+  [ERROR] invalid character `¼` in crate name: `a¼`, \ 
599+  characters must be Unicode XID characters (numbers, `-`, `_`, or most letters)
600+ If you need a crate name to not match the directory name, consider using --name flag. 
601+ " , 
573602        ) 
574603        . run ( ) ; 
575604} 
0 commit comments