Skip to content

Commit f262297

Browse files
committed
Add test for using unsupported mode in build command
1 parent f9335ba commit f262297

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/testsuite/build.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,27 @@ fn incremental_config() {
135135
.run();
136136
}
137137

138+
#[cargo_test]
139+
fn cargo_compile_with_unsupported_mode() {
140+
let p = project()
141+
.file("Cargo.toml", &basic_bin_manifest("foo"))
142+
.file("src/foo.rs", &main_file(r#""i am foo""#, &[]))
143+
.build();
144+
145+
p.cargo("build --debug")
146+
.with_stderr(
147+
"\
148+
error: unexpected argument '--debug' found
149+
150+
Usage: cargo[EXE] build [OPTIONS]
151+
152+
For more information, try '--help'.
153+
",
154+
)
155+
.with_status(1)
156+
.run();
157+
}
158+
138159
#[cargo_test]
139160
fn cargo_compile_with_workspace_excluded() {
140161
let p = project().file("src/main.rs", "fn main() {}").build();

0 commit comments

Comments
 (0)