Skip to content

Commit d071c59

Browse files
committed
Auto merge of #13829 - Muscraft:ensure-cap-lints, r=epage
test(cargo-lints): Add a test to ensure cap-lints works When implementing the linting system, [it was noted that there was no test to ensure this it is to cap-lints](#13621 (comment)), this PR adds that missing test.
2 parents cc20b55 + cbb1cd2 commit d071c59

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

tests/testsuite/lints_table.rs

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,3 +1022,59 @@ im-a-teapot = true
10221022
)
10231023
.run();
10241024
}
1025+
1026+
#[cargo_test]
1027+
fn cargo_lints_cap_lints() {
1028+
Package::new("baz", "0.1.0").publish();
1029+
Package::new("bar", "0.1.0")
1030+
.file(
1031+
"Cargo.toml",
1032+
r#"
1033+
[package]
1034+
name = "bar"
1035+
version = "0.1.0"
1036+
edition = "2021"
1037+
1038+
[dependencies]
1039+
baz = { version = "0.1.0", optional = true }
1040+
1041+
[lints.cargo]
1042+
implicit-features = "warn"
1043+
"#,
1044+
)
1045+
.file("src/lib.rs", "")
1046+
.publish();
1047+
let p = project()
1048+
.file(
1049+
"Cargo.toml",
1050+
r#"
1051+
[package]
1052+
name = "foo"
1053+
version = "0.1.0"
1054+
edition = "2021"
1055+
1056+
[dependencies]
1057+
bar = "0.1.0"
1058+
1059+
[lints.cargo]
1060+
implicit-features = "warn"
1061+
"#,
1062+
)
1063+
.file("src/lib.rs", "")
1064+
.build();
1065+
1066+
p.cargo("check -Zcargo-lints")
1067+
.masquerade_as_nightly_cargo(&["cargo-lints"])
1068+
.with_stderr(
1069+
"\
1070+
[UPDATING] [..]
1071+
[LOCKING] 2 packages to latest compatible versions
1072+
[DOWNLOADING] crates ...
1073+
[DOWNLOADED] bar v0.1.0 ([..])
1074+
[CHECKING] bar v0.1.0
1075+
[CHECKING] foo v0.1.0 ([CWD])
1076+
[FINISHED] [..]
1077+
",
1078+
)
1079+
.run();
1080+
}

0 commit comments

Comments
 (0)