mirror of https://github.com/rust-lang/cargo
Add test for empty feature name
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
This commit is contained in:
parent
dd3f434d0d
commit
d61816465f
|
@ -35,6 +35,37 @@ Caused by:
|
|||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn empty_feature_name() {
|
||||
let p = project()
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "foo"
|
||||
version = "0.0.1"
|
||||
authors = []
|
||||
|
||||
[features]
|
||||
"" = []
|
||||
"#,
|
||||
)
|
||||
.file("src/main.rs", "")
|
||||
.build();
|
||||
|
||||
p.cargo("check")
|
||||
.with_status(101)
|
||||
.with_stderr(
|
||||
"\
|
||||
[ERROR] failed to parse manifest at `[..]`
|
||||
|
||||
Caused by:
|
||||
feature name cannot be empty
|
||||
",
|
||||
)
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn same_name() {
|
||||
// Feature with the same name as a dependency.
|
||||
|
|
Loading…
Reference in New Issue