Skip to content

Commit 487bbc8

Browse files
committed
test(install): Verify edition=2024 is ignored
1 parent 49f096e commit 487bbc8

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

tests/testsuite/rust_version.rs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -998,6 +998,46 @@ fn cargo_install_ignores_resolver_v3_msrv_change() {
998998
.run();
999999
}
10001000

1001+
#[cargo_test(nightly, reason = "edition2024 in rustc is unstable")]
1002+
fn cargo_install_ignores_edition_2024_msrv_change() {
1003+
Package::new("dep", "1.0.0")
1004+
.rust_version("1.50")
1005+
.file("src/lib.rs", "fn hello() {}")
1006+
.publish();
1007+
Package::new("dep", "1.1.0")
1008+
.rust_version("1.70")
1009+
.file("src/lib.rs", "fn hello() {}")
1010+
.publish();
1011+
Package::new("foo", "0.0.1")
1012+
.rust_version("1.60")
1013+
.cargo_feature("edition2024")
1014+
.edition("2024")
1015+
.file("src/main.rs", "fn main() {}")
1016+
.dep("dep", "1")
1017+
.publish();
1018+
1019+
cargo_process("install foo")
1020+
.arg("-Zmsrv-policy")
1021+
.masquerade_as_nightly_cargo(&["edition2024", "msrv-policy"])
1022+
.with_stderr_data(str![[r#"
1023+
[UPDATING] `dummy-registry` index
1024+
[DOWNLOADING] crates ...
1025+
[DOWNLOADED] foo v0.0.1 (registry `dummy-registry`)
1026+
[INSTALLING] foo v0.0.1
1027+
[LOCKING] 1 package to latest compatible version
1028+
[DOWNLOADING] crates ...
1029+
[DOWNLOADED] dep v1.1.0 (registry `dummy-registry`)
1030+
[COMPILING] dep v1.1.0
1031+
[COMPILING] foo v0.0.1
1032+
[FINISHED] `release` profile [optimized] target(s) in [ELAPSED]s
1033+
[INSTALLING] [ROOT]/home/.cargo/bin/foo[EXE]
1034+
[INSTALLED] package `foo v0.0.1` (executable `foo[EXE]`)
1035+
[WARNING] be sure to add `[ROOT]/home/.cargo/bin` to your PATH to be able to run the installed binaries
1036+
1037+
"#]])
1038+
.run();
1039+
}
1040+
10011041
#[cargo_test]
10021042
fn report_rust_versions() {
10031043
Package::new("dep-only-low-compatible", "1.55.0")

0 commit comments

Comments
 (0)