diff options
Diffstat (limited to 'src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature')
13 files changed, 71 insertions, 0 deletions
diff --git a/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/in/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/in/Cargo.toml new file mode 100644 index 000000000..299859e79 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/in/Cargo.toml @@ -0,0 +1,2 @@ +[workspace] +members = ["primary", "dependency", "optional"] diff --git a/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/in/dependency/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/in/dependency/Cargo.toml new file mode 100644 index 000000000..34157f411 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/in/dependency/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "your-face" +version = "0.1.3" + +[dependencies] +toml_edit = "0.1.5" +atty = "0.2.13" +optional-dependency = { path = "../optional", optional = true } + +[features] +default = ["mouth"] +nose = [] +mouth = ["nose"] +eyes = [] diff --git a/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/in/dependency/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/in/dependency/src/lib.rs new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/in/dependency/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/in/optional/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/in/optional/Cargo.toml new file mode 100644 index 000000000..0216dba89 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/in/optional/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "optional-dep" +version = "0.1.3" + +[dependencies] +toml_edit = "0.1.5" +atty = "0.2.13" diff --git a/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/in/optional/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/in/optional/src/lib.rs new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/in/optional/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/in/primary/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/in/primary/Cargo.toml new file mode 100644 index 000000000..5e20016d7 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/in/primary/Cargo.toml @@ -0,0 +1,3 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" diff --git a/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/in/primary/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/in/primary/src/lib.rs new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/in/primary/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/mod.rs b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/mod.rs new file mode 100644 index 000000000..eadd096aa --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::prelude::*; +use cargo_test_support::Project; + +use crate::cargo_add::init_registry; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = project_root.join("primary"); + + snapbox::cmd::Command::cargo_ui() + .arg("add") + .arg_line("--path ../dependency --features your-face/nose") + .current_dir(&cwd) + .assert() + .code(101) + .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_add/path_inferred_name_conflicts_full_feature/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/out/Cargo.toml new file mode 100644 index 000000000..299859e79 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/out/Cargo.toml @@ -0,0 +1,2 @@ +[workspace] +members = ["primary", "dependency", "optional"] diff --git a/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/out/dependency/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/out/dependency/Cargo.toml new file mode 100644 index 000000000..34157f411 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/out/dependency/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "your-face" +version = "0.1.3" + +[dependencies] +toml_edit = "0.1.5" +atty = "0.2.13" +optional-dependency = { path = "../optional", optional = true } + +[features] +default = ["mouth"] +nose = [] +mouth = ["nose"] +eyes = [] diff --git a/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/out/primary/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/out/primary/Cargo.toml new file mode 100644 index 000000000..5e20016d7 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/out/primary/Cargo.toml @@ -0,0 +1,3 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" diff --git a/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/stderr.log b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/stderr.log new file mode 100644 index 000000000..791ca6008 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/stderr.log @@ -0,0 +1 @@ +error: `your-face/nose` is unsupported when inferring the crate name, use `nose` diff --git a/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/stdout.log b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/stdout.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/stdout.log |