Skip to content

Commit 95d7909

Browse files
committed
Add test for unsupported --path flag
Signed-off-by: hi-rustin <[email protected]>
1 parent 71de58d commit 95d7909

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/testsuite/build.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,28 @@ fn cargo_compile_manifest_path() {
205205
assert!(p.bin("foo").is_file());
206206
}
207207

208+
#[cargo_test]
209+
fn cargo_compile_with_wrong_manifest_path_flag() {
210+
let p = project()
211+
.file("Cargo.toml", &basic_bin_manifest("foo"))
212+
.file("src/foo.rs", &main_file(r#""i am foo""#, &[]))
213+
.build();
214+
215+
p.cargo("build --path foo/Cargo.toml")
216+
.cwd(p.root().parent().unwrap())
217+
.with_stderr(
218+
"\
219+
error: unexpected argument '--path' found
220+
221+
Usage: cargo[EXE] build [OPTIONS]
222+
223+
For more information, try '--help'.
224+
",
225+
)
226+
.with_status(1)
227+
.run();
228+
}
229+
208230
#[cargo_test]
209231
fn chdir_gated() {
210232
let p = project()

0 commit comments

Comments
 (0)