File tree Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,64 @@ Caused by:
179179 . run ( ) ;
180180}
181181
182+ #[ cargo_test]
183+ fn wrong_kind_of_feature ( ) {
184+ let p = project ( )
185+ . file (
186+ "Cargo.toml" ,
187+ r#"
188+ cargo-features = ["build-dir"]
189+
190+ [package]
191+ name = "a"
192+ version = "0.0.1"
193+ edition = "2015"
194+ authors = []
195+ "# ,
196+ )
197+ . file ( "src/lib.rs" , "" )
198+ . build ( ) ;
199+ p. cargo ( "check" )
200+ . with_status ( 101 )
201+ . with_stderr_data ( str![ [ r#"
202+ [ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml`
203+
204+ Caused by:
205+ unknown cargo feature `build-dir`
206+
207+ "# ] ] )
208+ . run ( ) ;
209+ }
210+
211+ #[ cargo_test]
212+ fn feature_syntax ( ) {
213+ let p = project ( )
214+ . file (
215+ "Cargo.toml" ,
216+ r#"
217+ cargo-features = ["bad_feature"]
218+
219+ [package]
220+ name = "a"
221+ version = "0.0.1"
222+ edition = "2015"
223+ authors = []
224+ "# ,
225+ )
226+ . file ( "src/lib.rs" , "" )
227+ . build ( ) ;
228+ p. cargo ( "check" )
229+ . with_status ( 101 )
230+ . with_stderr_data ( str![ [ r#"
231+ [ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml`
232+
233+ Caused by:
234+ unknown cargo feature `bad_feature`
235+
236+ "# ] ] )
237+ . run ( ) ;
238+ }
239+
182240#[ cargo_test]
183241fn stable_feature_warns ( ) {
184242 let p = project ( )
You can’t perform that action at this time.
0 commit comments