Skip to content

Commit 2f90430

Browse files
committed
Add test for unsupported short target triple flag
Signed-off-by: hi-rustin <[email protected]>
1 parent 6fa6fdc commit 2f90430

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/testsuite/build.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4239,6 +4239,28 @@ fn cargo_build_empty_target() {
42394239
.run();
42404240
}
42414241

4242+
#[cargo_test]
4243+
fn cargo_build_with_unsupported_short_target_flag() {
4244+
let p = project()
4245+
.file("Cargo.toml", &basic_bin_manifest("foo"))
4246+
.file("src/main.rs", "fn main() {}")
4247+
.build();
4248+
4249+
p.cargo("build -t")
4250+
.arg("")
4251+
.with_stderr(
4252+
"\
4253+
error: unexpected argument '-t' found
4254+
4255+
Usage: cargo[EXE] build [OPTIONS]
4256+
4257+
For more information, try '--help'.
4258+
",
4259+
)
4260+
.with_status(1)
4261+
.run();
4262+
}
4263+
42424264
#[cargo_test]
42434265
fn build_all_workspace() {
42444266
let p = project()

0 commit comments

Comments
 (0)