Skip to content

Commit

Permalink
Add test for unsupported short config flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Rustin170506 committed Oct 6, 2023
1 parent 5a2ea19 commit 9141199
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/testsuite/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,27 @@ For more information, try '--help'.
.run();
}

#[cargo_test]
fn cargo_compile_with_unsupported_short_config_flag() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.file("src/foo.rs", &main_file(r#""i am foo""#, &[]))
.build();

p.cargo("build -c net.git-fetch-with-cli=true")
.with_stderr(
"\
error: unexpected argument '-c' 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();
Expand Down

0 comments on commit 9141199

Please sign in to comment.