From 28b3b8943e0db7c605ad3515ba01a4aa0dee7eca Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Tue, 16 Aug 2022 20:57:42 +0800 Subject: [PATCH] Add test for aggressive update Signed-off-by: hi-rustin --- tests/testsuite/update.rs | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tests/testsuite/update.rs b/tests/testsuite/update.rs index 6151e207cdc3..f7eb0f5bb64c 100644 --- a/tests/testsuite/update.rs +++ b/tests/testsuite/update.rs @@ -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 \", 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 .