Skip to content

Commit

Permalink
Add test for unsupported short unstable feature flag
Browse files Browse the repository at this point in the history
Signed-off-by: hi-rustin <[email protected]>
  • Loading branch information
Rustin170506 committed Oct 7, 2023
1 parent 637ade0 commit 478506b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/testsuite/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,31 @@ fn cargo_compile_directory_not_cwd() {
assert!(p.bin("foo").is_file());
}

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

p.cargo("-zunstable-options -C foo build")
.masquerade_as_nightly_cargo(&["chdir"])
.cwd(p.root().parent().unwrap())
.with_stderr(
"\
error: unexpected argument '-z' found
Usage: cargo[EXE] [+toolchain] [OPTIONS] [COMMAND]
cargo [+toolchain] [OPTIONS] -Zscript <MANIFEST_RS> [ARGS]...
For more information, try '--help'.
",
)
.with_status(1)
.run();
}

#[cargo_test]
fn cargo_compile_directory_not_cwd_with_invalid_config() {
let p = project()
Expand Down

0 comments on commit 478506b

Please sign in to comment.