From c23a457e72abe608715ac76f076f47dc42af07a5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 20:31:44 +0200 Subject: Merging upstream version 1.74.1+dfsg1. Signed-off-by: Daniel Baumann --- src/tools/cargo/tests/testsuite/build.rs | 37 +++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 10 deletions(-) (limited to 'src/tools/cargo/tests/testsuite/build.rs') diff --git a/src/tools/cargo/tests/testsuite/build.rs b/src/tools/cargo/tests/testsuite/build.rs index 8cb064a6f..1afa83918 100644 --- a/src/tools/cargo/tests/testsuite/build.rs +++ b/src/tools/cargo/tests/testsuite/build.rs @@ -135,6 +135,29 @@ fn incremental_config() { .run(); } +#[cargo_test] +fn cargo_compile_with_redundant_default_mode() { + let p = project() + .file("Cargo.toml", &basic_bin_manifest("foo")) + .file("src/foo.rs", &main_file(r#""i am foo""#, &[])) + .build(); + + p.cargo("build --debug") + .with_stderr( + "\ +error: unexpected argument '--debug' found + + tip: `--debug` is the default for `cargo build`; instead `--release` is supported + +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(); @@ -258,9 +281,6 @@ fn cargo_compile_with_invalid_manifest2() { "\ [ERROR] failed to parse manifest at `[..]` -Caused by: - could not parse input as TOML - Caused by: TOML parse error at line 3, column 23 | @@ -283,9 +303,6 @@ fn cargo_compile_with_invalid_manifest3() { "\ [ERROR] failed to parse manifest at `[..]` -Caused by: - could not parse input as TOML - Caused by: TOML parse error at line 1, column 5 | @@ -346,8 +363,11 @@ fn cargo_compile_with_invalid_version() { [ERROR] failed to parse manifest at `[..]` Caused by: + TOML parse error at line 4, column 19 + | + 4 | version = \"1.0\" + | ^^^^^ unexpected end of input while parsing minor version number - in `package.version` ", ) .run(); @@ -3035,9 +3055,6 @@ fn bad_cargo_config() { Caused by: could not parse TOML configuration in `[..]` -Caused by: - could not parse input as TOML - Caused by: TOML parse error at line 1, column 6 | -- cgit v1.2.3