forked from rust-lang/cargo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sanchit Sahay
authored and
Sanchit Sahay
committed
Aug 4, 2024
1 parent
847a783
commit 4deea46
Showing
5 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../add-basic.in |
45 changes: 45 additions & 0 deletions
45
tests/testsuite/cargo_add/git_multiple_names_features/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters