This commit is contained in:
Jacob Finkelman 2023-10-19 18:44:42 +00:00
parent 48a79c923d
commit 6644828028
2 changed files with 52 additions and 1 deletions

View File

@ -116,7 +116,7 @@ enum Kind {
/// directive that we found in a lockfile, if present.
pub struct LockedPatchDependency {
/// The original `Dependency` directive, except "locked" so it's version
/// requirement is `=foo` and its `SourceId` has a "precise" listed.
/// requirement is Locked to `foo` and its `SourceId` has a "precise" listed.
pub dependency: Dependency,
/// The `PackageId` that was previously found in a lock file which
/// `dependency` matches.

View File

@ -3597,6 +3597,57 @@ fn differ_only_by_metadata() {
[CHECKING] baz v0.0.1+b
[CHECKING] foo v0.0.1 ([CWD])
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s
",
)
.run();
Package::new("baz", "0.0.1+d").publish();
p.cargo("clean").run();
p.cargo("check")
.with_stderr_contains("[CHECKING] baz v0.0.1+b")
.run();
}
#[cargo_test]
fn differ_only_by_metadata_with_lockfile() {
let p = project()
.file(
"Cargo.toml",
r#"
[package]
name = "foo"
version = "0.0.1"
authors = []
[dependencies]
baz = "=0.0.1"
"#,
)
.file("src/main.rs", "fn main() {}")
.build();
Package::new("baz", "0.0.1+a").publish();
Package::new("baz", "0.0.1+b").publish();
Package::new("baz", "0.0.1+c").publish();
p.cargo("update --package baz --precise 0.0.1+b")
.with_stderr(
"\
[UPDATING] [..] index
[..] baz v0.0.1+c -> v0.0.1+b
",
)
.run();
p.cargo("check")
.with_stderr(
"\
[DOWNLOADING] crates ...
[DOWNLOADED] [..] v0.0.1+b (registry `dummy-registry`)
[CHECKING] baz v0.0.1+b
[CHECKING] foo v0.0.1 ([CWD])
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s
",
)
.run();