Skip to content

Commit ec05156

Browse files
committed
Add test for unsupported short out dir flag
1 parent 288f424 commit ec05156

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/testsuite/out_dir.rs

+21
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,27 @@ fn cargo_build_out_dir() {
281281
);
282282
}
283283

284+
#[cargo_test]
285+
fn unsupported_short_out_dir_flag() {
286+
let p = project()
287+
.file("src/main.rs", r#"fn main() { println!("Hello, World!") }"#)
288+
.build();
289+
290+
p.cargo("build -Z unstable-options -O")
291+
.masquerade_as_nightly_cargo(&["out-dir"])
292+
.with_stderr(
293+
"\
294+
error: unexpected argument '-O' found
295+
296+
Usage: cargo[EXE] build [OPTIONS]
297+
298+
For more information, try '--help'.
299+
",
300+
)
301+
.with_status(1)
302+
.run();
303+
}
304+
284305
fn check_dir_contents(
285306
out_dir: &Path,
286307
expected_linux: &[&str],

0 commit comments

Comments
 (0)