From cdab0c0058384e2d3b768ec0c9997adc7b41988a Mon Sep 17 00:00:00 2001 From: Jonas Dohse Date: Wed, 17 Apr 2024 08:40:27 +0200 Subject: [PATCH 1/3] Add test case for fuzzy package adding issue #13702 --- .../in/Cargo.toml | 5 +++ .../in/primary/Cargo.toml | 4 +++ .../in/primary/src/lib.rs | 0 .../detect_workspace_inherit_fuzzy/mod.rs | 29 ++++++++++++++++ .../out/Cargo.toml | 5 +++ .../out/primary/Cargo.toml | 7 ++++ .../out/primary/src/lib.rs | 0 .../stderr.term.svg | 34 +++++++++++++++++++ tests/testsuite/cargo_add/mod.rs | 1 + 9 files changed, 85 insertions(+) create mode 100644 tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/in/Cargo.toml create mode 100644 tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/in/primary/Cargo.toml create mode 100644 tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/in/primary/src/lib.rs create mode 100644 tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/mod.rs create mode 100644 tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/out/Cargo.toml create mode 100644 tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/out/primary/Cargo.toml create mode 100644 tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/out/primary/src/lib.rs create mode 100644 tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/stderr.term.svg diff --git a/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/in/Cargo.toml b/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/in/Cargo.toml new file mode 100644 index 00000000000..44742d9e619 --- /dev/null +++ b/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/in/Cargo.toml @@ -0,0 +1,5 @@ +[workspace] +members = ["primary"] + +[workspace.dependencies] +fuzzy_dependency = "1.0.0" diff --git a/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/in/primary/Cargo.toml b/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/in/primary/Cargo.toml new file mode 100644 index 00000000000..fb520246281 --- /dev/null +++ b/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/in/primary/Cargo.toml @@ -0,0 +1,4 @@ +[package] +name = "bar" +version = "0.0.0" +edition = "2015" diff --git a/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/in/primary/src/lib.rs b/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/in/primary/src/lib.rs new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/mod.rs b/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/mod.rs new file mode 100644 index 00000000000..27c061228f9 --- /dev/null +++ b/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/mod.rs @@ -0,0 +1,29 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::current_dir; +use cargo_test_support::file; +use cargo_test_support::prelude::*; +use cargo_test_support::registry::Package; +use cargo_test_support::str; +use cargo_test_support::Project; + +#[cargo_test] +fn case() { + cargo_test_support::registry::init(); + + Package::new("fuzzy_dependency", "1.0.0").publish(); + + let project = Project::from_template(current_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("add") + .args(["fuzzy-dependency", "-p", "bar"]) + .current_dir(cwd) + .assert() + .success() + .stdout_eq(str![""]) + .stderr_eq(file!["stderr.term.svg"]); + + assert_ui().subset_matches(current_dir!().join("out"), &project_root); +} diff --git a/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/out/Cargo.toml b/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/out/Cargo.toml new file mode 100644 index 00000000000..44742d9e619 --- /dev/null +++ b/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/out/Cargo.toml @@ -0,0 +1,5 @@ +[workspace] +members = ["primary"] + +[workspace.dependencies] +fuzzy_dependency = "1.0.0" diff --git a/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/out/primary/Cargo.toml b/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/out/primary/Cargo.toml new file mode 100644 index 00000000000..1ae5f7b6361 --- /dev/null +++ b/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/out/primary/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "bar" +version = "0.0.0" +edition = "2015" + +[dependencies] +fuzzy_dependency = "1.0.0" diff --git a/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/out/primary/src/lib.rs b/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/out/primary/src/lib.rs new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/stderr.term.svg b/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/stderr.term.svg new file mode 100644 index 00000000000..2530de07194 --- /dev/null +++ b/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/stderr.term.svg @@ -0,0 +1,34 @@ + + + + + + + Updating `dummy-registry` index + + warning: translating `fuzzy-dependency` to `fuzzy_dependency` + + Adding fuzzy_dependency v1.0.0 to dependencies + + Locking 1 package to latest compatible version + + + + + + diff --git a/tests/testsuite/cargo_add/mod.rs b/tests/testsuite/cargo_add/mod.rs index 62feb8422c8..ff96419281b 100644 --- a/tests/testsuite/cargo_add/mod.rs +++ b/tests/testsuite/cargo_add/mod.rs @@ -13,6 +13,7 @@ mod deprecated_default_features; mod deprecated_section; mod detect_workspace_inherit; mod detect_workspace_inherit_features; +mod detect_workspace_inherit_fuzzy; mod detect_workspace_inherit_optional; mod detect_workspace_inherit_public; mod dev; From 140911cc1207f1d16bb2c5d6ca644f04397a4449 Mon Sep 17 00:00:00 2001 From: Jonas Dohse Date: Wed, 17 Apr 2024 08:40:39 +0200 Subject: [PATCH 2/3] Add test case for feature adding with fuzzy name #10680 --- .../cargo_add/features_fuzzy/in/Cargo.toml | 9 ++++ .../cargo_add/features_fuzzy/in/src/lib.rs | 0 .../testsuite/cargo_add/features_fuzzy/mod.rs | 32 +++++++++++++ .../cargo_add/features_fuzzy/out/Cargo.toml | 9 ++++ .../cargo_add/features_fuzzy/stderr.term.svg | 45 +++++++++++++++++++ tests/testsuite/cargo_add/mod.rs | 1 + 6 files changed, 96 insertions(+) create mode 100644 tests/testsuite/cargo_add/features_fuzzy/in/Cargo.toml create mode 100644 tests/testsuite/cargo_add/features_fuzzy/in/src/lib.rs create mode 100644 tests/testsuite/cargo_add/features_fuzzy/mod.rs create mode 100644 tests/testsuite/cargo_add/features_fuzzy/out/Cargo.toml create mode 100644 tests/testsuite/cargo_add/features_fuzzy/stderr.term.svg diff --git a/tests/testsuite/cargo_add/features_fuzzy/in/Cargo.toml b/tests/testsuite/cargo_add/features_fuzzy/in/Cargo.toml new file mode 100644 index 00000000000..62909ec87fd --- /dev/null +++ b/tests/testsuite/cargo_add/features_fuzzy/in/Cargo.toml @@ -0,0 +1,9 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" +edition = "2015" + +[dependencies] +your_face = { version = "99999.0.0", features = ["eyes"] } \ No newline at end of file diff --git a/tests/testsuite/cargo_add/features_fuzzy/in/src/lib.rs b/tests/testsuite/cargo_add/features_fuzzy/in/src/lib.rs new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/testsuite/cargo_add/features_fuzzy/mod.rs b/tests/testsuite/cargo_add/features_fuzzy/mod.rs new file mode 100644 index 00000000000..f5d96445b28 --- /dev/null +++ b/tests/testsuite/cargo_add/features_fuzzy/mod.rs @@ -0,0 +1,32 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::current_dir; +use cargo_test_support::file; +use cargo_test_support::prelude::*; +use cargo_test_support::str; +use cargo_test_support::Project; + +#[cargo_test] +fn case() { + cargo_test_support::registry::init(); + cargo_test_support::registry::Package::new("your_face", "99999.0.0+my-package") + .feature("nose", &[]) + .feature("mouth", &[]) + .feature("eyes", &[]) + .feature("ears", &[]) + .publish(); + + let project = Project::from_template(current_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("add") + .arg_line("your-face") + .current_dir(cwd) + .assert() + .success() + .stdout_eq(str![""]) + .stderr_eq(file!["stderr.term.svg"]); + + assert_ui().subset_matches(current_dir!().join("out"), &project_root); +} diff --git a/tests/testsuite/cargo_add/features_fuzzy/out/Cargo.toml b/tests/testsuite/cargo_add/features_fuzzy/out/Cargo.toml new file mode 100644 index 00000000000..a50d1f6d256 --- /dev/null +++ b/tests/testsuite/cargo_add/features_fuzzy/out/Cargo.toml @@ -0,0 +1,9 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" +edition = "2015" + +[dependencies] +your_face = { version = "99999.0.0" } diff --git a/tests/testsuite/cargo_add/features_fuzzy/stderr.term.svg b/tests/testsuite/cargo_add/features_fuzzy/stderr.term.svg new file mode 100644 index 00000000000..8f5778eb5c3 --- /dev/null +++ b/tests/testsuite/cargo_add/features_fuzzy/stderr.term.svg @@ -0,0 +1,45 @@ + + + + + + + Updating `dummy-registry` index + + warning: translating `your-face` to `your_face` + + Adding your_face v99999.0.0 to dependencies + + Features: + + - ears + + - eyes + + - mouth + + - nose + + Locking 1 package to latest compatible version + + + + + + diff --git a/tests/testsuite/cargo_add/mod.rs b/tests/testsuite/cargo_add/mod.rs index ff96419281b..efe5680431a 100644 --- a/tests/testsuite/cargo_add/mod.rs +++ b/tests/testsuite/cargo_add/mod.rs @@ -25,6 +25,7 @@ mod features; mod features_activated_over_limit; mod features_deactivated_over_limit; mod features_empty; +mod features_fuzzy; mod features_multiple_occurrences; mod features_preserve; mod features_spaced_values; From 9391bfb34d307ead02c00261de9f506feb45cb76 Mon Sep 17 00:00:00 2001 From: Jonas Dohse Date: Wed, 1 May 2024 15:05:22 +0200 Subject: [PATCH 3/3] Fix #10680, Fix #13702 --- src/cargo/ops/cargo_add/mod.rs | 43 ++++++++++++++++++- .../add_workspace_non_fuzzy/in/Cargo.lock | 11 +++++ .../add_workspace_non_fuzzy/in/Cargo.toml | 2 + .../in/fuzzy_name/Cargo.toml | 4 ++ .../in/fuzzy_name/src/lib.rs | 0 .../in/primary/Cargo.toml | 7 +++ .../in/primary/src/lib.rs | 0 .../cargo_add/add_workspace_non_fuzzy/mod.rs | 24 +++++++++++ .../add_workspace_non_fuzzy/out/Cargo.toml | 2 + .../out/primary/Cargo.toml | 7 +++ .../out/primary/src/lib.rs | 0 .../add_workspace_non_fuzzy/stderr.term.svg | 30 +++++++++++++ .../out/primary/Cargo.toml | 2 +- .../stderr.term.svg | 6 +-- .../cargo_add/features_fuzzy/out/Cargo.toml | 2 +- .../cargo_add/features_fuzzy/stderr.term.svg | 8 ++-- tests/testsuite/cargo_add/mod.rs | 1 + 17 files changed, 138 insertions(+), 11 deletions(-) create mode 100644 tests/testsuite/cargo_add/add_workspace_non_fuzzy/in/Cargo.lock create mode 100644 tests/testsuite/cargo_add/add_workspace_non_fuzzy/in/Cargo.toml create mode 100644 tests/testsuite/cargo_add/add_workspace_non_fuzzy/in/fuzzy_name/Cargo.toml create mode 100644 tests/testsuite/cargo_add/add_workspace_non_fuzzy/in/fuzzy_name/src/lib.rs create mode 100644 tests/testsuite/cargo_add/add_workspace_non_fuzzy/in/primary/Cargo.toml create mode 100644 tests/testsuite/cargo_add/add_workspace_non_fuzzy/in/primary/src/lib.rs create mode 100644 tests/testsuite/cargo_add/add_workspace_non_fuzzy/mod.rs create mode 100644 tests/testsuite/cargo_add/add_workspace_non_fuzzy/out/Cargo.toml create mode 100644 tests/testsuite/cargo_add/add_workspace_non_fuzzy/out/primary/Cargo.toml create mode 100644 tests/testsuite/cargo_add/add_workspace_non_fuzzy/out/primary/src/lib.rs create mode 100644 tests/testsuite/cargo_add/add_workspace_non_fuzzy/stderr.term.svg diff --git a/src/cargo/ops/cargo_add/mod.rs b/src/cargo/ops/cargo_add/mod.rs index c6f71847df3..ad5d6f1230d 100644 --- a/src/cargo/ops/cargo_add/mod.rs +++ b/src/cargo/ops/cargo_add/mod.rs @@ -361,7 +361,9 @@ fn resolve_dependency( }; selected_dep = populate_dependency(selected_dep, arg); - let old_dep = get_existing_dependency(manifest, selected_dep.toml_key(), section)?; + let lookup = |dep_key: &_| get_existing_dependency(manifest, dep_key, section); + let old_dep = fuzzy_lookup(&mut selected_dep, lookup, gctx)?; + let mut dependency = if let Some(mut old_dep) = old_dep.clone() { if old_dep.name != selected_dep.name { // Assuming most existing keys are not relevant when the package changes @@ -383,7 +385,8 @@ fn resolve_dependency( if dependency.source().is_none() { // Checking for a workspace dependency happens first since a member could be specified // in the workspace dependencies table as a dependency - if let Some(_dep) = find_workspace_dep(dependency.toml_key(), ws.root_manifest()).ok() { + let lookup = |toml_key: &_| Ok(find_workspace_dep(toml_key, ws.root_manifest()).ok()); + if let Some(_dep) = fuzzy_lookup(&mut dependency, lookup, gctx)? { dependency = dependency.set_source(WorkspaceSource::new()); } else if let Some(package) = ws.members().find(|p| p.name().as_str() == dependency.name) { // Only special-case workspaces when the user doesn't provide any extra @@ -449,6 +452,42 @@ fn resolve_dependency( Ok(dependency) } +fn fuzzy_lookup( + dependency: &mut Dependency, + lookup: impl Fn(&str) -> CargoResult>, + gctx: &GlobalContext, +) -> CargoResult> { + if let Some(rename) = dependency.rename() { + // Manually implement `toml_key` to restrict fuzzy lookups to only package names to mirror `PackageRegistry::query()` + return lookup(rename); + } + + for name_permutation in [ + dependency.name.clone(), + dependency.name.replace('-', "_"), + dependency.name.replace('_', "-"), + ] { + let Some(dep) = lookup(&name_permutation)? else { + continue; + }; + + if dependency.name != name_permutation { + // Mirror the fuzzy matching policy of `PackageRegistry::query()` + if !matches!(dep.source, Some(Source::Registry(_))) { + continue; + } + gctx.shell().warn(format!( + "translating `{}` to `{}`", + dependency.name, &name_permutation, + ))?; + dependency.name = name_permutation; + } + return Ok(Some(dep)); + } + + Ok(None) +} + /// When { workspace = true } you cannot define other keys that configure /// the source of the dependency such as `version`, `registry`, `registry-index`, /// `path`, `git`, `branch`, `tag`, `rev`, or `package`. You can also not define diff --git a/tests/testsuite/cargo_add/add_workspace_non_fuzzy/in/Cargo.lock b/tests/testsuite/cargo_add/add_workspace_non_fuzzy/in/Cargo.lock new file mode 100644 index 00000000000..8c304c1c338 --- /dev/null +++ b/tests/testsuite/cargo_add/add_workspace_non_fuzzy/in/Cargo.lock @@ -0,0 +1,11 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "bar" +version = "0.0.0" + +[[package]] +name = "fuzzy_name" +version = "0.0.0" diff --git a/tests/testsuite/cargo_add/add_workspace_non_fuzzy/in/Cargo.toml b/tests/testsuite/cargo_add/add_workspace_non_fuzzy/in/Cargo.toml new file mode 100644 index 00000000000..fcfea321a63 --- /dev/null +++ b/tests/testsuite/cargo_add/add_workspace_non_fuzzy/in/Cargo.toml @@ -0,0 +1,2 @@ +[workspace] +members = ["primary", "fuzzy_name"] diff --git a/tests/testsuite/cargo_add/add_workspace_non_fuzzy/in/fuzzy_name/Cargo.toml b/tests/testsuite/cargo_add/add_workspace_non_fuzzy/in/fuzzy_name/Cargo.toml new file mode 100644 index 00000000000..4c2f380e12f --- /dev/null +++ b/tests/testsuite/cargo_add/add_workspace_non_fuzzy/in/fuzzy_name/Cargo.toml @@ -0,0 +1,4 @@ +[package] +name = "fuzzy_name" +version = "0.0.0" +edition = "2015" diff --git a/tests/testsuite/cargo_add/add_workspace_non_fuzzy/in/fuzzy_name/src/lib.rs b/tests/testsuite/cargo_add/add_workspace_non_fuzzy/in/fuzzy_name/src/lib.rs new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/testsuite/cargo_add/add_workspace_non_fuzzy/in/primary/Cargo.toml b/tests/testsuite/cargo_add/add_workspace_non_fuzzy/in/primary/Cargo.toml new file mode 100644 index 00000000000..85cf9b05ced --- /dev/null +++ b/tests/testsuite/cargo_add/add_workspace_non_fuzzy/in/primary/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "bar" +version = "0.0.0" +edition = "2015" + +[dependencies] +fuzzy_name = { path = "../fuzzy_name" } diff --git a/tests/testsuite/cargo_add/add_workspace_non_fuzzy/in/primary/src/lib.rs b/tests/testsuite/cargo_add/add_workspace_non_fuzzy/in/primary/src/lib.rs new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/testsuite/cargo_add/add_workspace_non_fuzzy/mod.rs b/tests/testsuite/cargo_add/add_workspace_non_fuzzy/mod.rs new file mode 100644 index 00000000000..19c86524222 --- /dev/null +++ b/tests/testsuite/cargo_add/add_workspace_non_fuzzy/mod.rs @@ -0,0 +1,24 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::current_dir; +use cargo_test_support::file; +use cargo_test_support::prelude::*; +use cargo_test_support::str; +use cargo_test_support::Project; + +#[cargo_test] +fn case() { + let project = Project::from_template(current_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("add") + .args(["fuzzy-name", "-p", "bar"]) + .current_dir(cwd) + .assert() + .code(101) + .stdout_eq(str![""]) + .stderr_eq(file!["stderr.term.svg"]); + + assert_ui().subset_matches(current_dir!().join("out"), &project_root); +} diff --git a/tests/testsuite/cargo_add/add_workspace_non_fuzzy/out/Cargo.toml b/tests/testsuite/cargo_add/add_workspace_non_fuzzy/out/Cargo.toml new file mode 100644 index 00000000000..fcfea321a63 --- /dev/null +++ b/tests/testsuite/cargo_add/add_workspace_non_fuzzy/out/Cargo.toml @@ -0,0 +1,2 @@ +[workspace] +members = ["primary", "fuzzy_name"] diff --git a/tests/testsuite/cargo_add/add_workspace_non_fuzzy/out/primary/Cargo.toml b/tests/testsuite/cargo_add/add_workspace_non_fuzzy/out/primary/Cargo.toml new file mode 100644 index 00000000000..85cf9b05ced --- /dev/null +++ b/tests/testsuite/cargo_add/add_workspace_non_fuzzy/out/primary/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "bar" +version = "0.0.0" +edition = "2015" + +[dependencies] +fuzzy_name = { path = "../fuzzy_name" } diff --git a/tests/testsuite/cargo_add/add_workspace_non_fuzzy/out/primary/src/lib.rs b/tests/testsuite/cargo_add/add_workspace_non_fuzzy/out/primary/src/lib.rs new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/testsuite/cargo_add/add_workspace_non_fuzzy/stderr.term.svg b/tests/testsuite/cargo_add/add_workspace_non_fuzzy/stderr.term.svg new file mode 100644 index 00000000000..6c9588b1a20 --- /dev/null +++ b/tests/testsuite/cargo_add/add_workspace_non_fuzzy/stderr.term.svg @@ -0,0 +1,30 @@ + + + + + + + Updating crates.io index + + error: the crate `fuzzy-name` could not be found in registry index. + + + + + + diff --git a/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/out/primary/Cargo.toml b/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/out/primary/Cargo.toml index 1ae5f7b6361..22737f57682 100644 --- a/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/out/primary/Cargo.toml +++ b/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/out/primary/Cargo.toml @@ -4,4 +4,4 @@ version = "0.0.0" edition = "2015" [dependencies] -fuzzy_dependency = "1.0.0" +fuzzy_dependency.workspace = true diff --git a/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/stderr.term.svg b/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/stderr.term.svg index 2530de07194..a2a8a98f0e8 100644 --- a/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/stderr.term.svg +++ b/tests/testsuite/cargo_add/detect_workspace_inherit_fuzzy/stderr.term.svg @@ -19,11 +19,11 @@ - Updating `dummy-registry` index + warning: translating `fuzzy-dependency` to `fuzzy_dependency` - warning: translating `fuzzy-dependency` to `fuzzy_dependency` + Updating `dummy-registry` index - Adding fuzzy_dependency v1.0.0 to dependencies + Adding fuzzy_dependency (workspace) to dependencies Locking 1 package to latest compatible version diff --git a/tests/testsuite/cargo_add/features_fuzzy/out/Cargo.toml b/tests/testsuite/cargo_add/features_fuzzy/out/Cargo.toml index a50d1f6d256..42049792df2 100644 --- a/tests/testsuite/cargo_add/features_fuzzy/out/Cargo.toml +++ b/tests/testsuite/cargo_add/features_fuzzy/out/Cargo.toml @@ -6,4 +6,4 @@ version = "0.0.0" edition = "2015" [dependencies] -your_face = { version = "99999.0.0" } +your_face = { version = "99999.0.0", features = ["eyes"] } diff --git a/tests/testsuite/cargo_add/features_fuzzy/stderr.term.svg b/tests/testsuite/cargo_add/features_fuzzy/stderr.term.svg index 8f5778eb5c3..70eb9fefc9c 100644 --- a/tests/testsuite/cargo_add/features_fuzzy/stderr.term.svg +++ b/tests/testsuite/cargo_add/features_fuzzy/stderr.term.svg @@ -20,17 +20,17 @@ - Updating `dummy-registry` index + warning: translating `your-face` to `your_face` - warning: translating `your-face` to `your_face` + Updating `dummy-registry` index Adding your_face v99999.0.0 to dependencies Features: - - ears + + eyes - - eyes + - ears - mouth diff --git a/tests/testsuite/cargo_add/mod.rs b/tests/testsuite/cargo_add/mod.rs index efe5680431a..8207d5fd387 100644 --- a/tests/testsuite/cargo_add/mod.rs +++ b/tests/testsuite/cargo_add/mod.rs @@ -4,6 +4,7 @@ mod add_no_vendored_package_with_alter_registry; mod add_no_vendored_package_with_vendor; mod add_normalized_name_external; mod add_toolchain; +mod add_workspace_non_fuzzy; mod build; mod build_prefer_existing_version; mod change_rename_target;