Skip to content

Commit

Permalink
Add test for empty feature name
Browse files Browse the repository at this point in the history
Signed-off-by: hi-rustin <[email protected]>
  • Loading branch information
Rustin170506 committed Nov 8, 2023
1 parent dd3f434 commit d618164
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/testsuite/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d618164

Please sign in to comment.