From 8eb0ecc3fc2112c8a3f96b3f9c5a9a83fdd65f99 Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Tue, 19 Sep 2023 10:52:27 +0800 Subject: [PATCH] Add test for using unsupported mode in install command --- tests/testsuite/install.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/testsuite/install.rs b/tests/testsuite/install.rs index c7658037271c..b49cbec315ec 100644 --- a/tests/testsuite/install.rs +++ b/tests/testsuite/install.rs @@ -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: There is no `--release` for `cargo install`. Only `--debug` is supported. + +Usage: cargo[EXE] install [OPTIONS] [crate]... + +For more information, try '--help'. +", + ) + .with_status(1) + .run(); +}