Skip to content

Commit

Permalink
Remove useless log deps and add more test for precise update
Browse files Browse the repository at this point in the history
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
  • Loading branch information
Rustin170506 committed Aug 21, 2022
1 parent f0b5bda commit 64e3991
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion tests/testsuite/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,6 @@ fn change_package_version() {

#[cargo_test]
fn update_precise() {
Package::new("log", "0.1.0").publish();
Package::new("serde", "0.1.0").publish();
Package::new("serde", "0.2.1").publish();

Expand Down Expand Up @@ -392,6 +391,42 @@ fn update_precise() {
.run();
}

#[cargo_test]
fn update_precise_do_not_force_update_deps() {
Package::new("log", "0.1.0").publish();
Package::new("serde", "0.2.1").dep("log", "0.1").publish();

let p = project()
.file(
"Cargo.toml",
r#"
[package]
name = "bar"
version = "0.0.1"
authors = []
[dependencies]
serde = "0.2"
"#,
)
.file("src/lib.rs", "")
.build();

p.cargo("build").run();

Package::new("log", "0.1.1").publish();
Package::new("serde", "0.2.2").dep("log", "0.1").publish();

p.cargo("update -p serde:0.2.1 --precise 0.2.2")
.with_stderr(
"\
[UPDATING] `[..]` index
[UPDATING] serde v0.2.1 -> v0.2.2
",
)
.run();
}

#[cargo_test]
fn update_precise_without_package() {
Package::new("serde", "0.2.0").publish();
Expand Down

0 comments on commit 64e3991

Please sign in to comment.