diff --git a/tests/testsuite/cargo_add/git_multiple_names_features/in b/tests/testsuite/cargo_add/git_multiple_names_features/in new file mode 100644 index 000000000000..6c6a27fcfb58 --- /dev/null +++ b/tests/testsuite/cargo_add/git_multiple_names_features/in @@ -0,0 +1 @@ +../add-basic.in \ No newline at end of file diff --git a/tests/testsuite/cargo_add/git_multiple_names_features/mod.rs b/tests/testsuite/cargo_add/git_multiple_names_features/mod.rs new file mode 100644 index 000000000000..01280c2d18f5 --- /dev/null +++ b/tests/testsuite/cargo_add/git_multiple_names_features/mod.rs @@ -0,0 +1,45 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::prelude::*; +use cargo_test_support::Project; + +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + cargo_test_support::registry::init(); + + for name in ["pack1", "pack2"] { + cargo_test_support::registry::Package::new(name, "v0.1") + .feature(&format!("feat-{}", name)[..], &[]) + .publish(); + } + + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + let git_dep = cargo_test_support::git::new("git-package", |project| { + project + .file( + "p1/Cargo.toml", + &cargo_test_support::basic_manifest("pack1", "v0.1"), + ) + .file("p1/src/lib.rs", "") + .file( + "p2/Cargo.toml", + &cargo_test_support::basic_manifest("pack2", "v0.1"), + ) + .file("p2/src/lib.rs", "") + }); + let git_url = git_dep.url().to_string(); + + snapbox::cmd::Command::cargo_ui() + .arg("add") + .args(["pack1", "--git", &git_url, "--features=feat-pack1"]) + .current_dir(cwd) + .assert() + .success() + .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/tests/testsuite/cargo_add/git_multiple_names_features/stderr.log b/tests/testsuite/cargo_add/git_multiple_names_features/stderr.log new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/testsuite/cargo_add/git_multiple_names_features/stdout.log b/tests/testsuite/cargo_add/git_multiple_names_features/stdout.log new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/testsuite/cargo_add/mod.rs b/tests/testsuite/cargo_add/mod.rs index 62feb8422c85..4fba3a8a57c8 100644 --- a/tests/testsuite/cargo_add/mod.rs +++ b/tests/testsuite/cargo_add/mod.rs @@ -36,7 +36,11 @@ mod git_dev; mod git_inferred_name; mod git_inferred_name_multiple; mod git_multiple_names; +<<<<<<< HEAD mod git_multiple_packages_features; +======= +mod git_multiple_names_features; +>>>>>>> f8d0db7dc (failing test: git repo with multiple names and features) mod git_normalized_name; mod git_registry; mod git_rev;