test(lints): Show bug with lints on stable

This commit is contained in:
Ed Page 2023-05-15 21:55:36 -05:00
parent a7555f976e
commit 66038fad36

View file

@ -67,6 +67,70 @@ See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#lints for mo
.run();
}
#[cargo_test]
fn malformed_on_stable() {
let foo = project()
.file(
"Cargo.toml",
r#"
lints = 20
[package]
name = "foo"
version = "0.0.1"
authors = []
"#,
)
.file("src/lib.rs", "")
.build();
foo.cargo("check")
.with_status(101)
.with_stderr(
"\
error: failed to parse manifest[..]
Caused by:
invalid type: integer `20`, expected a map
in `lints`
",
)
.run();
}
#[cargo_test]
fn malformed_on_nightly() {
let foo = project()
.file(
"Cargo.toml",
r#"
cargo-features = ["lints"]
lints = 20
[package]
name = "foo"
version = "0.0.1"
authors = []
"#,
)
.file("src/lib.rs", "")
.build();
foo.cargo("check")
.masquerade_as_nightly_cargo(&["lints"])
.with_status(101)
.with_stderr(
"\
error: failed to parse manifest[..]
Caused by:
invalid type: integer `20`, expected a map
in `lints`
",
)
.run();
}
#[cargo_test]
fn fail_on_invalid_tool() {
let foo = project()