Skip to content

Commit

Permalink
test(msrv): Show msrv resolver issue
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Sep 19, 2024
1 parent 892ad41 commit 64abeb2
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions tests/testsuite/rust_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,26 @@ fn resolve_with_multiple_rust_versions() {
.file("src/lib.rs", "fn other_stuff() {}")
.publish();
}
Package::new(&format!("lower-only-newer"), "1.65.0")
.rust_version("1.65.0")
.file("src/lib.rs", "fn other_stuff() {}")
.publish();
for ver in ["1.45.0", "1.55.0"] {
Package::new(&format!("lower-newer-and-older"), ver)
.rust_version(ver)
.file("src/lib.rs", "fn other_stuff() {}")
.publish();
}
Package::new(&format!("higher-only-newer"), "1.65.0")
.rust_version("1.65.0")
.file("src/lib.rs", "fn other_stuff() {}")
.publish();
for ver in ["1.55.0", "1.65.0"] {
Package::new(&format!("higher-newer-and-older"), ver)
.rust_version(ver)
.file("src/lib.rs", "fn other_stuff() {}")
.publish();
}

let p = project()
.file(
Expand All @@ -435,6 +455,8 @@ fn resolve_with_multiple_rust_versions() {
rust-version = "1.60.0"
[dependencies]
higher-only-newer = "1"
higher-newer-and-older = "1"
shared-only-newer = "1"
shared-newer-and-older = "1"
"#,
Expand All @@ -451,6 +473,8 @@ fn resolve_with_multiple_rust_versions() {
rust-version = "1.50.0"
[dependencies]
lower-only-newer = "1"
lower-newer-and-older = "1"
shared-only-newer = "1"
shared-newer-and-older = "1"
"#,
Expand All @@ -464,13 +488,15 @@ fn resolve_with_multiple_rust_versions() {
.masquerade_as_nightly_cargo(&["msrv-policy"])
.with_stderr_data(str![[r#"
[UPDATING] `dummy-registry` index
[LOCKING] 2 packages to latest compatible versions
[LOCKING] 6 packages to latest compatible versions
"#]])
.run();
p.cargo("tree")
.with_stdout_data(str![[r#"
higher v0.0.1 ([ROOT]/foo)
├── higher-newer-and-older v1.65.0
├── higher-only-newer v1.65.0
├── shared-newer-and-older v1.65.0
└── shared-only-newer v1.65.0
Expand All @@ -483,7 +509,11 @@ higher v0.0.1 ([ROOT]/foo)
.masquerade_as_nightly_cargo(&["msrv-policy"])
.with_stderr_data(str![[r#"
[UPDATING] `dummy-registry` index
[LOCKING] 2 packages to latest Rust 1.50.0 compatible versions
[LOCKING] 6 packages to latest Rust 1.50.0 compatible versions
[ADDING] higher-newer-and-older v1.65.0 (requires Rust 1.65.0)
[ADDING] higher-only-newer v1.65.0 (requires Rust 1.65.0)
[ADDING] lower-newer-and-older v1.45.0 (available: v1.55.0, requires Rust 1.55.0)
[ADDING] lower-only-newer v1.65.0 (requires Rust 1.65.0)
[ADDING] shared-newer-and-older v1.45.0 (available: v1.65.0, requires Rust 1.65.0)
[ADDING] shared-only-newer v1.65.0 (requires Rust 1.65.0)
Expand All @@ -492,6 +522,8 @@ higher v0.0.1 ([ROOT]/foo)
p.cargo("tree")
.with_stdout_data(str![[r#"
higher v0.0.1 ([ROOT]/foo)
├── higher-newer-and-older v1.65.0
├── higher-only-newer v1.65.0
├── shared-newer-and-older v1.45.0
└── shared-only-newer v1.65.0
Expand Down

0 comments on commit 64abeb2

Please sign in to comment.