Skip to content

Commit 64e3991

Browse files
committed
Remove useless log deps and add more test for precise update
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
1 parent f0b5bda commit 64e3991

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

tests/testsuite/update.rs

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ fn change_package_version() {
344344

345345
#[cargo_test]
346346
fn update_precise() {
347-
Package::new("log", "0.1.0").publish();
348347
Package::new("serde", "0.1.0").publish();
349348
Package::new("serde", "0.2.1").publish();
350349

@@ -392,6 +391,42 @@ fn update_precise() {
392391
.run();
393392
}
394393

394+
#[cargo_test]
395+
fn update_precise_do_not_force_update_deps() {
396+
Package::new("log", "0.1.0").publish();
397+
Package::new("serde", "0.2.1").dep("log", "0.1").publish();
398+
399+
let p = project()
400+
.file(
401+
"Cargo.toml",
402+
r#"
403+
[package]
404+
name = "bar"
405+
version = "0.0.1"
406+
authors = []
407+
408+
[dependencies]
409+
serde = "0.2"
410+
"#,
411+
)
412+
.file("src/lib.rs", "")
413+
.build();
414+
415+
p.cargo("build").run();
416+
417+
Package::new("log", "0.1.1").publish();
418+
Package::new("serde", "0.2.2").dep("log", "0.1").publish();
419+
420+
p.cargo("update -p serde:0.2.1 --precise 0.2.2")
421+
.with_stderr(
422+
"\
423+
[UPDATING] `[..]` index
424+
[UPDATING] serde v0.2.1 -> v0.2.2
425+
",
426+
)
427+
.run();
428+
}
429+
395430
#[cargo_test]
396431
fn update_precise_without_package() {
397432
Package::new("serde", "0.2.0").publish();

0 commit comments

Comments
 (0)