Add test for empty feature name

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
This commit is contained in:
hi-rustin 2023-11-07 20:03:35 +08:00
parent dd3f434d0d
commit d61816465f
1 changed files with 31 additions and 0 deletions

View File

@ -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.