Skip to content

Commit 4deea46

Browse files
Sanchit SahaySanchit Sahay
authored andcommitted
random
1 parent 847a783 commit 4deea46

File tree

5 files changed

+50
-0
lines changed

5 files changed

+50
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../add-basic.in
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
use cargo_test_support::compare::assert_ui;
2+
use cargo_test_support::prelude::*;
3+
use cargo_test_support::Project;
4+
5+
use cargo_test_support::curr_dir;
6+
7+
#[cargo_test]
8+
fn case() {
9+
cargo_test_support::registry::init();
10+
11+
for name in ["pack1", "pack2"] {
12+
cargo_test_support::registry::Package::new(name, "v0.1")
13+
.feature(&format!("feat-{}", name)[..], &[])
14+
.publish();
15+
}
16+
17+
let project = Project::from_template(curr_dir!().join("in"));
18+
let project_root = project.root();
19+
let cwd = &project_root;
20+
let git_dep = cargo_test_support::git::new("git-package", |project| {
21+
project
22+
.file(
23+
"p1/Cargo.toml",
24+
&cargo_test_support::basic_manifest("pack1", "v0.1"),
25+
)
26+
.file("p1/src/lib.rs", "")
27+
.file(
28+
"p2/Cargo.toml",
29+
&cargo_test_support::basic_manifest("pack2", "v0.1"),
30+
)
31+
.file("p2/src/lib.rs", "")
32+
});
33+
let git_url = git_dep.url().to_string();
34+
35+
snapbox::cmd::Command::cargo_ui()
36+
.arg("add")
37+
.args(["pack1", "--git", &git_url, "--features=feat-pack1"])
38+
.current_dir(cwd)
39+
.assert()
40+
.success()
41+
.stdout_matches_path(curr_dir!().join("stdout.log"))
42+
.stderr_matches_path(curr_dir!().join("stderr.log"));
43+
44+
assert_ui().subset_matches(curr_dir!().join("out"), &project_root);
45+
}

tests/testsuite/cargo_add/git_multiple_names_features/stderr.log

Whitespace-only changes.

tests/testsuite/cargo_add/git_multiple_names_features/stdout.log

Whitespace-only changes.

tests/testsuite/cargo_add/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ mod git_dev;
3636
mod git_inferred_name;
3737
mod git_inferred_name_multiple;
3838
mod git_multiple_names;
39+
<<<<<<< HEAD
3940
mod git_multiple_packages_features;
41+
=======
42+
mod git_multiple_names_features;
43+
>>>>>>> f8d0db7dc (failing test: git repo with multiple names and features)
4044
mod git_normalized_name;
4145
mod git_registry;
4246
mod git_rev;

0 commit comments

Comments
 (0)