Add test for using unsupported mode in install command

This commit is contained in:
hi-rustin 2023-09-19 10:52:27 +08:00
parent ed86337492
commit 7644a4bd96

View file

@ -2443,3 +2443,23 @@ fn ambiguous_registry_vs_local_package() {
.run();
assert_has_installed_exe(cargo_home(), "foo");
}
#[cargo_test]
fn install_with_unsupported_mode() {
pkg("foo", "0.0.1");
cargo_process("install foo --release")
.with_stderr(
"\
error: unexpected argument '--release' found
tip: a similar argument exists: '--examples'
Usage: cargo[EXE] install --examples [crate]...
For more information, try '--help'.
",
)
.with_status(1)
.run();
}