diff options
Diffstat (limited to 'src/tools/cargo/tests/testsuite/cargo_add/features_preserve')
6 files changed, 48 insertions, 0 deletions
diff --git a/src/tools/cargo/tests/testsuite/cargo_add/features_preserve/in/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_add/features_preserve/in/Cargo.toml new file mode 100644 index 000000000..11419b203 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/features_preserve/in/Cargo.toml @@ -0,0 +1,8 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +your-face = { version = "99999.0.0", features = ["eyes"] } diff --git a/src/tools/cargo/tests/testsuite/cargo_add/features_preserve/in/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_add/features_preserve/in/src/lib.rs new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/features_preserve/in/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/cargo_add/features_preserve/mod.rs b/src/tools/cargo/tests/testsuite/cargo_add/features_preserve/mod.rs new file mode 100644 index 000000000..ed99a3111 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/features_preserve/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::prelude::*; +use cargo_test_support::Project; + +use crate::cargo_add::init_registry; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("add") + .arg_line("your-face") + .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/src/tools/cargo/tests/testsuite/cargo_add/features_preserve/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_add/features_preserve/out/Cargo.toml new file mode 100644 index 000000000..11419b203 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/features_preserve/out/Cargo.toml @@ -0,0 +1,8 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +your-face = { version = "99999.0.0", features = ["eyes"] } diff --git a/src/tools/cargo/tests/testsuite/cargo_add/features_preserve/stderr.log b/src/tools/cargo/tests/testsuite/cargo_add/features_preserve/stderr.log new file mode 100644 index 000000000..386f3db5a --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/features_preserve/stderr.log @@ -0,0 +1,7 @@ + Updating `dummy-registry` index + Adding your-face v99999.0.0 to dependencies. + Features: + + eyes + - ears + - mouth + - nose diff --git a/src/tools/cargo/tests/testsuite/cargo_add/features_preserve/stdout.log b/src/tools/cargo/tests/testsuite/cargo_add/features_preserve/stdout.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/features_preserve/stdout.log |