Skip to content

Commit

Permalink
failing test: git repo with multiple names and features
Browse files Browse the repository at this point in the history
  • Loading branch information
stupendoussuperpowers committed Dec 28, 2023
1 parent 078ee97 commit f8d0db7
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/testsuite/cargo_add/git_multiple_names_features/in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
../add-basic.in
45 changes: 45 additions & 0 deletions tests/testsuite/cargo_add/git_multiple_names_features/mod.rs
Original file line number Diff line number Diff line change
@@ -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);
}
Empty file.
Empty file.
1 change: 1 addition & 0 deletions tests/testsuite/cargo_add/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ mod git_dev;
mod git_inferred_name;
mod git_inferred_name_multiple;
mod git_multiple_names;
mod git_multiple_names_features;
mod git_normalized_name;
mod git_registry;
mod git_rev;
Expand Down

0 comments on commit f8d0db7

Please sign in to comment.