Skip to content

Commit

Permalink
Add test for aggressive 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 16, 2022
1 parent 6080428 commit 28b3b89
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/testsuite/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,41 @@ fn update_precise_without_package() {
.run();
}

#[cargo_test]
fn update_aggressive_without_package() {
Package::new("serde", "0.2.0").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("serde", "0.2.1").publish();

p.cargo("update --aggressive")
.with_stderr(
"\
[WARNING] aggressive is only supported with \"--package <SPEC>\", this will become a hard error in a future release.
[UPDATING] `[..]` index
[UPDATING] serde v0.2.0 -> v0.2.1
",
)
.run();
}

// cargo update should respect its arguments even without a lockfile.
// See issue "Running cargo update without a Cargo.lock ignores arguments"
// at <https://github.com/rust-lang/cargo/issues/6872>.
Expand Down

0 comments on commit 28b3b89

Please sign in to comment.