mirror of
https://github.com/rust-lang/cargo
synced 2024-09-19 07:41:57 +00:00
test(lints): Check unused key status
This commit is contained in:
parent
bde42f1bc6
commit
ef6954cd01
|
@ -148,6 +148,36 @@ Caused by:
|
||||||
.run();
|
.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cargo_test]
|
||||||
|
fn warn_on_unused_key() {
|
||||||
|
let foo = project()
|
||||||
|
.file(
|
||||||
|
"Cargo.toml",
|
||||||
|
r#"
|
||||||
|
[package]
|
||||||
|
name = "foo"
|
||||||
|
version = "0.0.1"
|
||||||
|
|
||||||
|
[workspace.lints.rust]
|
||||||
|
rust-2018-idioms = { level = "allow", unused = true }
|
||||||
|
[lints.rust]
|
||||||
|
rust-2018-idioms = { level = "allow", unused = true }
|
||||||
|
"#,
|
||||||
|
)
|
||||||
|
.file("src/lib.rs", "")
|
||||||
|
.build();
|
||||||
|
|
||||||
|
foo.cargo("check")
|
||||||
|
.with_stderr(
|
||||||
|
"\
|
||||||
|
[WARNING] [CWD]/Cargo.toml: unused manifest key: workspace.lints.rust.rust-2018-idioms.unused
|
||||||
|
[CHECKING] foo v0.0.1 ([CWD])
|
||||||
|
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s
|
||||||
|
",
|
||||||
|
)
|
||||||
|
.run();
|
||||||
|
}
|
||||||
|
|
||||||
#[cargo_test]
|
#[cargo_test]
|
||||||
fn fail_on_tool_injection() {
|
fn fail_on_tool_injection() {
|
||||||
let foo = project()
|
let foo = project()
|
||||||
|
|
Loading…
Reference in a new issue