Skip to content

Commit

Permalink
test(install): Verify existing top-level MSRV behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Oct 9, 2023
1 parent c97c906 commit 699b30a
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/testsuite/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2463,3 +2463,30 @@ For more information, try '--help'.
.with_status(1)
.run();
}

#[cargo_test]
fn install_incompat_msrv() {
Package::new("foo", "0.1.0")
.file("src/main.rs", "fn main() {}")
.rust_version("1.30")
.publish();
Package::new("foo", "0.2.0")
.file("src/main.rs", "fn main() {}")
.rust_version("1.9876.0")
.publish();

cargo_process("install foo")
.with_stderr("\
[UPDATING] `dummy-registry` index
[DOWNLOADING] crates ...
[DOWNLOADED] foo v0.2.0 (registry `[..]`)
[INSTALLING] foo v0.2.0
[ERROR] failed to compile `foo v0.2.0`, intermediate artifacts can be found at `[..]`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
Caused by:
package `foo v0.2.0` cannot be built because it requires rustc 1.9876.0 or newer, while the currently active rustc version is [..]
Try re-running cargo install with `--locked`
")
.with_status(101).run();
}

0 comments on commit 699b30a

Please sign in to comment.