Skip to content

Commit

Permalink
test(registry): Show current too-new schema error
Browse files Browse the repository at this point in the history
This reproduces the problem in rust-lang#10623.
  • Loading branch information
epage committed May 26, 2023
1 parent b8a3fc4 commit fd58cac
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/testsuite/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2632,6 +2632,41 @@ fn ignores_unknown_index_version() {
.run();
}

#[cargo_test]
fn unknown_index_version_error() {
// If the version field is not understood, it is ignored.
Package::new("bar", "1.0.1")
.schema_version(u32::MAX)
.publish();

let p = project()
.file(
"Cargo.toml",
r#"
[package]
name = "foo"
version = "0.1.0"
[dependencies]
bar = "1.0"
"#,
)
.file("src/lib.rs", "")
.build();

p.cargo("generate-lockfile")
.with_status(101)
.with_stderr(
"\
[UPDATING] `dummy-registry` index
[ERROR] no matching package named `bar` found
location searched: registry `crates-io`
required by package `foo v0.1.0 ([CWD])`
",
)
.run();
}

#[cargo_test]
fn protocol() {
cargo_process("install bar")
Expand Down

0 comments on commit fd58cac

Please sign in to comment.