Skip to content

Commit f0b5bda

Browse files
committed
Add test for aggressive update
Signed-off-by: hi-rustin <[email protected]>
1 parent 1ac83ba commit f0b5bda

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

tests/testsuite/update.rs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,43 @@ fn update_precise_without_package() {
428428
.run();
429429
}
430430

431+
#[cargo_test]
432+
fn update_aggressive() {
433+
Package::new("log", "0.1.0").publish();
434+
Package::new("serde", "0.2.1").dep("log", "0.1").publish();
435+
436+
let p = project()
437+
.file(
438+
"Cargo.toml",
439+
r#"
440+
[package]
441+
name = "bar"
442+
version = "0.0.1"
443+
authors = []
444+
445+
[dependencies]
446+
serde = "0.2"
447+
"#,
448+
)
449+
.file("src/lib.rs", "")
450+
.build();
451+
452+
p.cargo("build").run();
453+
454+
Package::new("log", "0.1.1").publish();
455+
Package::new("serde", "0.2.2").dep("log", "0.1").publish();
456+
457+
p.cargo("update -p serde:0.2.1 --aggressive")
458+
.with_stderr(
459+
"\
460+
[UPDATING] `[..]` index
461+
[UPDATING] log v0.1.0 -> v0.1.1
462+
[UPDATING] serde v0.2.1 -> v0.2.2
463+
",
464+
)
465+
.run();
466+
}
467+
431468
#[cargo_test]
432469
fn update_aggressive_without_package() {
433470
Package::new("serde", "0.2.0").publish();

0 commit comments

Comments
 (0)