Skip to content

Commit 4b04343

Browse files
committed
Add test for using unsupported mode in build command
1 parent bc60c30 commit 4b04343

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/testsuite/build.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,29 @@ 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+
tip: There is no `--debug` for `cargo build`. Only `--release` is supported.
151+
152+
Usage: cargo[EXE] build [OPTIONS]
153+
154+
For more information, try '--help'.
155+
",
156+
)
157+
.with_status(1)
158+
.run();
159+
}
160+
138161
#[cargo_test]
139162
fn cargo_compile_with_workspace_excluded() {
140163
let p = project().file("src/main.rs", "fn main() {}").build();

0 commit comments

Comments
 (0)