From: Fredrik Larsson Date: Sat, 28 Oct 2017 14:36:49 +0000 (+0200) Subject: Test partially successful uninstallation X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~5^2~20^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=05224d67cf1d6a1c4aa08ac09a8a9e1dbb95f57a;p=cargo.git Test partially successful uninstallation --- diff --git a/tests/install.rs b/tests/install.rs index 2353f31a3..0b43acc44 100644 --- a/tests/install.rs +++ b/tests/install.rs @@ -970,3 +970,24 @@ fn uninstall_multiple_and_specifying_bin() { error: A binary can only be associated with a single installed package, specifying multiple specs with --bin is redundant. ")); } + +#[test] +fn uninstall_multiple_and_some_pkg_does_not_exist() { + pkg("foo", "0.0.1"); + + assert_that(cargo_process("install").arg("foo"), + execs().with_status(0)); + + assert_that(cargo_process("uninstall").args(&["foo", "bar"]), + execs().with_status(101).with_stderr(&format!("\ +[REMOVING] {home}[..]bin[..]foo[..] +error: package id specification `bar` matched no packages + +Summary: Successfully uninstalled foo! Failed to uninstall bar (see error(s) above). +error: some packages failed to uninstall +", + home = cargo_home().display()))); + + assert_that(cargo_home(), is_not(has_installed_exe("foo"))); + assert_that(cargo_home(), is_not(has_installed_exe("bar"))); +}