Add test for using unsupported mode in build command

This commit is contained in:
hi-rustin 2023-09-19 10:46:05 +08:00
parent f9335babbc
commit f262297e9a

View File

@ -135,6 +135,27 @@ fn incremental_config() {
.run();
}
#[cargo_test]
fn cargo_compile_with_unsupported_mode() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.file("src/foo.rs", &main_file(r#""i am foo""#, &[]))
.build();
p.cargo("build --debug")
.with_stderr(
"\
error: unexpected argument '--debug' found
Usage: cargo[EXE] build [OPTIONS]
For more information, try '--help'.
",
)
.with_status(1)
.run();
}
#[cargo_test]
fn cargo_compile_with_workspace_excluded() {
let p = project().file("src/main.rs", "fn main() {}").build();