2022-06-21 19:59:54 +00:00
|
|
|
use cargo_test_support::compare::assert_ui;
|
2022-05-07 01:51:29 +00:00
|
|
|
use cargo_test_support::prelude::*;
|
|
|
|
use cargo_test_support::Project;
|
|
|
|
|
|
|
|
use cargo_test_support::curr_dir;
|
|
|
|
|
|
|
|
#[cargo_test]
|
2023-02-20 17:25:14 +00:00
|
|
|
fn case() {
|
2023-05-26 14:24:45 +00:00
|
|
|
cargo_test_support::registry::init();
|
|
|
|
for ver in [
|
|
|
|
"0.1.1+my-package",
|
|
|
|
"0.2.0+my-package",
|
|
|
|
"0.2.3+my-package",
|
|
|
|
"0.4.1+my-package",
|
|
|
|
"20.0.0+my-package",
|
|
|
|
"99999.0.0+my-package",
|
|
|
|
"99999.0.0-alpha.1+my-package",
|
|
|
|
] {
|
|
|
|
cargo_test_support::registry::Package::new("my-package1", ver).publish();
|
|
|
|
}
|
|
|
|
cargo_test_support::registry::Package::new("your-face", "99999.0.0+my-package")
|
|
|
|
.feature("nose", &[])
|
|
|
|
.feature("mouth", &[])
|
|
|
|
.feature("eyes", &[])
|
|
|
|
.feature("ears", &[])
|
|
|
|
.publish();
|
|
|
|
|
2022-05-07 01:51:29 +00:00
|
|
|
let project = Project::from_template(curr_dir!().join("in"));
|
|
|
|
let project_root = project.root();
|
|
|
|
let cwd = &project_root;
|
|
|
|
|
2022-06-21 19:59:54 +00:00
|
|
|
snapbox::cmd::Command::cargo_ui()
|
2022-05-07 01:51:29 +00:00
|
|
|
.arg("add")
|
|
|
|
.arg_line("my-package1 your-face --features nose")
|
|
|
|
.current_dir(cwd)
|
|
|
|
.assert()
|
|
|
|
.code(101)
|
|
|
|
.stdout_matches_path(curr_dir!().join("stdout.log"))
|
|
|
|
.stderr_matches_path(curr_dir!().join("stderr.log"));
|
|
|
|
|
2022-06-21 19:59:54 +00:00
|
|
|
assert_ui().subset_matches(curr_dir!().join("out"), &project_root);
|
2022-05-07 01:51:29 +00:00
|
|
|
}
|