mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
add test
This commit is contained in:
parent
48a79c923d
commit
6644828028
@ -116,7 +116,7 @@ enum Kind {
|
|||||||
/// directive that we found in a lockfile, if present.
|
/// directive that we found in a lockfile, if present.
|
||||||
pub struct LockedPatchDependency {
|
pub struct LockedPatchDependency {
|
||||||
/// The original `Dependency` directive, except "locked" so it's version
|
/// 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,
|
pub dependency: Dependency,
|
||||||
/// The `PackageId` that was previously found in a lock file which
|
/// The `PackageId` that was previously found in a lock file which
|
||||||
/// `dependency` matches.
|
/// `dependency` matches.
|
||||||
|
@ -3597,6 +3597,57 @@ fn differ_only_by_metadata() {
|
|||||||
[CHECKING] baz v0.0.1+b
|
[CHECKING] baz v0.0.1+b
|
||||||
[CHECKING] foo v0.0.1 ([CWD])
|
[CHECKING] foo v0.0.1 ([CWD])
|
||||||
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s
|
[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();
|
.run();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user