Skip to content

Commit f22b84f

Browse files
committed
test(workspace): clippy fix work on all crate members
1 parent a7be79b commit f22b84f

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

tests/testsuite/workspaces.rs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2716,3 +2716,43 @@ fn nonexistence_package_together_with_workspace() {
27162716
"#]])
27172717
.run();
27182718
}
2719+
2720+
// A failing case from <https://github.com/rust-lang/cargo/issues/15625>
2721+
#[cargo_test]
2722+
fn clippy_fix_all_members_in_a_workspace() {
2723+
let p = project()
2724+
.file(
2725+
"Cargo.toml",
2726+
r#"
2727+
[workspace]
2728+
members = ["foo", "bar"]
2729+
resolver = "3"
2730+
"#,
2731+
)
2732+
.file(
2733+
"foo/Cargo.toml",
2734+
r#"
2735+
[package]
2736+
name = "foo"
2737+
version = "0.1.0"
2738+
edition = "2021"
2739+
"#,
2740+
)
2741+
.file("foo/src/main.rs", "fn main() {}")
2742+
.file(
2743+
"bar/Cargo.toml",
2744+
r#"
2745+
[package]
2746+
name = "bar"
2747+
version = "0.1.0"
2748+
edition = "2021"
2749+
"#,
2750+
)
2751+
.file("bar/src/main.rs", "fn main() {}")
2752+
.build();
2753+
2754+
p.cargo("clippy --manifest-path foo/Cargo.toml --fix --allow-no-vcs")
2755+
.with_stderr_contains("[CHECKING] foo v0.1.0 ([ROOT]/foo/foo)")
2756+
.with_stderr_contains("[CHECKING] bar v0.1.0 ([ROOT]/foo/bar)")
2757+
.run();
2758+
}

0 commit comments

Comments
 (0)