Skip to content

Commit 784ddcc

Browse files
committed
Add test for aggressive update
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
1 parent 4eada76 commit 784ddcc

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

tests/testsuite/update.rs

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

431+
#[cargo_test]
432+
fn update_aggressive_without_package() {
433+
Package::new("serde", "0.2.0").publish();
434+
435+
let p = project()
436+
.file(
437+
"Cargo.toml",
438+
r#"
439+
[package]
440+
name = "bar"
441+
version = "0.0.1"
442+
authors = []
443+
444+
[dependencies]
445+
serde = "0.2"
446+
"#,
447+
)
448+
.file("src/lib.rs", "")
449+
.build();
450+
451+
p.cargo("build").run();
452+
453+
Package::new("serde", "0.2.1").publish();
454+
455+
p.cargo("update --aggressive")
456+
.with_stderr(
457+
"\
458+
[WARNING] aggressive is only supported with \"--package <SPEC>\", this will become a hard error in a future release.
459+
[UPDATING] `[..]` index
460+
[UPDATING] serde v0.2.0 -> v0.2.1
461+
",
462+
)
463+
.run();
464+
}
465+
431466
// cargo update should respect its arguments even without a lockfile.
432467
// See issue "Running cargo update without a Cargo.lock ignores arguments"
433468
// at <https://github.com/rust-lang/cargo/issues/6872>.

0 commit comments

Comments
 (0)