Skip to content

Commit 06b5ec5

Browse files
committed
test(resolver): Show error with MSRV set
1 parent d2fcf6b commit 06b5ec5

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

tests/testsuite/registry.rs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3238,6 +3238,43 @@ required by package `foo v0.1.0 ([ROOT]/foo)`
32383238
.run();
32393239
}
32403240

3241+
#[cargo_test]
3242+
fn unknown_index_version_with_msrv_error() {
3243+
// If the version field is not understood, it is ignored.
3244+
Package::new("bar", "1.0.1")
3245+
.schema_version(u32::MAX)
3246+
.rust_version("1.2345")
3247+
.publish();
3248+
3249+
let p = project()
3250+
.file(
3251+
"Cargo.toml",
3252+
r#"
3253+
[package]
3254+
name = "foo"
3255+
version = "0.1.0"
3256+
edition = "2015"
3257+
3258+
[dependencies]
3259+
bar = "1.0"
3260+
"#,
3261+
)
3262+
.file("src/lib.rs", "")
3263+
.build();
3264+
3265+
p.cargo("generate-lockfile")
3266+
.with_status(101)
3267+
.with_stderr_data(str![[r#"
3268+
[UPDATING] `dummy-registry` index
3269+
[ERROR] no matching versions for `bar` found
3270+
version 1.0.1 requires a Cargo version that supports index version 4294967295
3271+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
3272+
required by package `foo v0.1.0 ([ROOT]/foo)`
3273+
3274+
"#]])
3275+
.run();
3276+
}
3277+
32413278
#[cargo_test]
32423279
fn protocol() {
32433280
cargo_process("install bar")

0 commit comments

Comments
 (0)