Skip to content

Commit 478506b

Browse files
committed
Add test for unsupported short unstable feature flag
Signed-off-by: hi-rustin <[email protected]>
1 parent 637ade0 commit 478506b

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/testsuite/build.rs

+25
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,31 @@ fn cargo_compile_directory_not_cwd() {
244244
assert!(p.bin("foo").is_file());
245245
}
246246

247+
#[cargo_test]
248+
fn cargo_compile_with_unsupported_short_unstable_feature_flag() {
249+
let p = project()
250+
.file("Cargo.toml", &basic_bin_manifest("foo"))
251+
.file("src/foo.rs", &main_file(r#""i am foo""#, &[]))
252+
.file(".cargo/config.toml", &"")
253+
.build();
254+
255+
p.cargo("-zunstable-options -C foo build")
256+
.masquerade_as_nightly_cargo(&["chdir"])
257+
.cwd(p.root().parent().unwrap())
258+
.with_stderr(
259+
"\
260+
error: unexpected argument '-z' found
261+
262+
Usage: cargo[EXE] [+toolchain] [OPTIONS] [COMMAND]
263+
cargo [+toolchain] [OPTIONS] -Zscript <MANIFEST_RS> [ARGS]...
264+
265+
For more information, try '--help'.
266+
",
267+
)
268+
.with_status(1)
269+
.run();
270+
}
271+
247272
#[cargo_test]
248273
fn cargo_compile_directory_not_cwd_with_invalid_config() {
249274
let p = project()

0 commit comments

Comments
 (0)