Skip to content

Commit 9141199

Browse files
committed
Add test for unsupported short config flag
1 parent 5a2ea19 commit 9141199

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
@@ -158,6 +158,27 @@ For more information, try '--help'.
158158
.run();
159159
}
160160

161+
#[cargo_test]
162+
fn cargo_compile_with_unsupported_short_config_flag() {
163+
let p = project()
164+
.file("Cargo.toml", &basic_bin_manifest("foo"))
165+
.file("src/foo.rs", &main_file(r#""i am foo""#, &[]))
166+
.build();
167+
168+
p.cargo("build -c net.git-fetch-with-cli=true")
169+
.with_stderr(
170+
"\
171+
error: unexpected argument '-c' found
172+
173+
Usage: cargo[EXE] build [OPTIONS]
174+
175+
For more information, try '--help'.
176+
",
177+
)
178+
.with_status(1)
179+
.run();
180+
}
181+
161182
#[cargo_test]
162183
fn cargo_compile_with_workspace_excluded() {
163184
let p = project().file("src/main.rs", "fn main() {}").build();

0 commit comments

Comments
 (0)