test(toml): Verify missing package.name

This commit is contained in:
Ed Page 2025-02-06 14:54:30 -06:00
parent fcb79a5c45
commit 5f529f792d

View File

@ -470,6 +470,31 @@ expected `}`
.run();
}
#[cargo_test]
fn cargo_toml_missing_package_name() {
let p = project()
.file(
"Cargo.toml",
r#"
[package]
"#,
)
.build();
p.cargo("check")
.with_status(101)
.with_stderr_data(str![[r#"
[ERROR] missing field `name`
--> Cargo.toml:2:16
|
2 | [package]
| ^^^^^^^^^
|
"#]])
.run();
}
#[cargo_test]
fn duplicate_binary_names() {
let p = project()