Skip to content

Commit 4899913

Browse files
committed
Duplicates of unknown_feature test
1 parent 8c6cdff commit 4899913

File tree

1 file changed

+61
-1
lines changed

1 file changed

+61
-1
lines changed

tests/testsuite/cargo_features.rs

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,67 @@ fn unknown_feature() {
173173
[ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml`
174174
175175
Caused by:
176-
unknown cargo feature `foo`
176+
unknown Cargo.toml feature `foo`
177+
178+
See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html for more information.
179+
180+
"#]])
181+
.run();
182+
}
183+
184+
#[cargo_test]
185+
fn wrong_kind_of_feature() {
186+
let p = project()
187+
.file(
188+
"Cargo.toml",
189+
r#"
190+
cargo-features = ["build-dir"]
191+
192+
[package]
193+
name = "a"
194+
version = "0.0.1"
195+
edition = "2015"
196+
authors = []
197+
"#,
198+
)
199+
.file("src/lib.rs", "")
200+
.build();
201+
p.cargo("check")
202+
.with_status(101)
203+
.with_stderr_data(str![[r#"
204+
[ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml`
205+
206+
Caused by:
207+
unknown cargo feature `build-dir`
208+
209+
"#]])
210+
.run();
211+
}
212+
213+
#[cargo_test]
214+
fn feature_syntax() {
215+
let p = project()
216+
.file(
217+
"Cargo.toml",
218+
r#"
219+
cargo-features = ["bad_feature"]
220+
221+
[package]
222+
name = "a"
223+
version = "0.0.1"
224+
edition = "2015"
225+
authors = []
226+
"#,
227+
)
228+
.file("src/lib.rs", "")
229+
.build();
230+
p.cargo("check")
231+
.with_status(101)
232+
.with_stderr_data(str![[r#"
233+
[ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml`
234+
235+
Caused by:
236+
unknown cargo feature `bad_feature`
177237
178238
"#]])
179239
.run();

0 commit comments

Comments
 (0)