diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:26:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:26:03 +0000 |
commit | 9918693037dce8aa4bb6f08741b6812923486c18 (patch) | |
tree | 21d2b40bec7e6a7ea664acee056eb3d08e15a1cf /src/tools/cargo/tests/testsuite/cargo_new | |
parent | Releasing progress-linux version 1.75.0+dfsg1-5~progress7.99u1. (diff) | |
download | rustc-9918693037dce8aa4bb6f08741b6812923486c18.tar.xz rustc-9918693037dce8aa4bb6f08741b6812923486c18.zip |
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/cargo/tests/testsuite/cargo_new')
7 files changed, 25 insertions, 1 deletions
diff --git a/src/tools/cargo/tests/testsuite/cargo_new/empty_name/in/.keep b/src/tools/cargo/tests/testsuite/cargo_new/empty_name/in/.keep new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_new/empty_name/in/.keep diff --git a/src/tools/cargo/tests/testsuite/cargo_new/empty_name/mod.rs b/src/tools/cargo/tests/testsuite/cargo_new/empty_name/mod.rs new file mode 100644 index 000000000..a7d56630f --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_new/empty_name/mod.rs @@ -0,0 +1,22 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::curr_dir; +use cargo_test_support::CargoCommand; +use cargo_test_support::Project; + +#[cargo_test] +fn case() { + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("new") + .args(["foo", "--name", ""]) + .current_dir(cwd) + .assert() + .failure() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_new/empty_name/out/.keep b/src/tools/cargo/tests/testsuite/cargo_new/empty_name/out/.keep new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_new/empty_name/out/.keep diff --git a/src/tools/cargo/tests/testsuite/cargo_new/empty_name/stderr.log b/src/tools/cargo/tests/testsuite/cargo_new/empty_name/stderr.log new file mode 100644 index 000000000..d9547a42a --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_new/empty_name/stderr.log @@ -0,0 +1 @@ +error: package name cannot be empty diff --git a/src/tools/cargo/tests/testsuite/cargo_new/empty_name/stdout.log b/src/tools/cargo/tests/testsuite/cargo_new/empty_name/stdout.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_new/empty_name/stdout.log diff --git a/src/tools/cargo/tests/testsuite/cargo_new/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_new/help/stdout.log index 3df5eceb8..52a6f83a1 100644 --- a/src/tools/cargo/tests/testsuite/cargo_new/help/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_new/help/stdout.log @@ -15,8 +15,8 @@ Options: 2021, 2024] --name <NAME> Set the resulting package name, defaults to the directory name --registry <REGISTRY> Registry to use - -q, --quiet Do not print cargo log messages -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + -q, --quiet Do not print cargo log messages --color <WHEN> Coloring: auto, always, never --config <KEY=VALUE> Override a configuration value -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details diff --git a/src/tools/cargo/tests/testsuite/cargo_new/mod.rs b/src/tools/cargo/tests/testsuite/cargo_new/mod.rs index da0304409..806bd2ec3 100644 --- a/src/tools/cargo/tests/testsuite/cargo_new/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_new/mod.rs @@ -4,6 +4,7 @@ mod add_members_to_workspace_with_absolute_package_path; mod add_members_to_workspace_with_empty_members; mod add_members_to_workspace_with_exclude_list; mod add_members_to_workspace_with_members_glob; +mod empty_name; mod help; mod inherit_workspace_lints; mod inherit_workspace_package_table; |