mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-25 11:14:46 +00:00
test(manifest): Verify we warn on unused workspace.package fields
Inspired by #13258
This commit is contained in:
parent
13e97927cc
commit
96fa278540
@ -1650,6 +1650,37 @@ fn warn_inherit_unused_manifest_key_dep() {
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn warn_unused_workspace_package_field() {
|
||||
Package::new("dep", "0.1.0").publish();
|
||||
|
||||
let p = project()
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[workspace]
|
||||
members = []
|
||||
[workspace.package]
|
||||
name = "unused"
|
||||
|
||||
[package]
|
||||
name = "foo"
|
||||
"#,
|
||||
)
|
||||
.file("src/main.rs", "fn main() {}")
|
||||
.build();
|
||||
|
||||
p.cargo("check")
|
||||
.with_stderr(
|
||||
"\
|
||||
[WARNING] [CWD]/Cargo.toml: unused manifest key: workspace.package.name
|
||||
[CHECKING] foo v0.0.0 ([CWD])
|
||||
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
|
||||
",
|
||||
)
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn warn_inherit_unused_manifest_key_package() {
|
||||
Package::new("dep", "0.1.0").publish();
|
||||
|
Loading…
x
Reference in New Issue
Block a user