summaryrefslogtreecommitdiffstats
path: root/src/tools/cargo/tests/testsuite/out_dir.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/cargo/tests/testsuite/out_dir.rs')
-rw-r--r--src/tools/cargo/tests/testsuite/out_dir.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/tools/cargo/tests/testsuite/out_dir.rs b/src/tools/cargo/tests/testsuite/out_dir.rs
index fe647f56e..83621a2d2 100644
--- a/src/tools/cargo/tests/testsuite/out_dir.rs
+++ b/src/tools/cargo/tests/testsuite/out_dir.rs
@@ -281,6 +281,29 @@ fn cargo_build_out_dir() {
);
}
+#[cargo_test]
+fn unsupported_short_out_dir_flag() {
+ let p = project()
+ .file("src/main.rs", r#"fn main() { println!("Hello, World!") }"#)
+ .build();
+
+ p.cargo("build -Z unstable-options -O")
+ .masquerade_as_nightly_cargo(&["out-dir"])
+ .with_stderr(
+ "\
+error: unexpected argument '-O' found
+
+ tip: a similar argument exists: '--out-dir'
+
+Usage: cargo[EXE] build [OPTIONS]
+
+For more information, try '--help'.
+",
+ )
+ .with_status(1)
+ .run();
+}
+
fn check_dir_contents(
out_dir: &Path,
expected_linux: &[&str],