diff --git a/tests/testsuite/features.rs b/tests/testsuite/features.rs index 236b6f65181..e44807941d1 100644 --- a/tests/testsuite/features.rs +++ b/tests/testsuite/features.rs @@ -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.