diff options
Diffstat (limited to 'tests/testsuite/cargo_add/features_unknown')
5 files changed, 36 insertions, 0 deletions
diff --git a/tests/testsuite/cargo_add/features_unknown/in b/tests/testsuite/cargo_add/features_unknown/in new file mode 120000 index 0000000..6c6a27f --- /dev/null +++ b/tests/testsuite/cargo_add/features_unknown/in @@ -0,0 +1 @@ +../add-basic.in
\ No newline at end of file diff --git a/tests/testsuite/cargo_add/features_unknown/mod.rs b/tests/testsuite/cargo_add/features_unknown/mod.rs new file mode 100644 index 0000000..7fd8d95 --- /dev/null +++ b/tests/testsuite/cargo_add/features_unknown/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 --features noze") + .current_dir(cwd) + .assert() + .code(101) + .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/tests/testsuite/cargo_add/features_unknown/out/Cargo.toml b/tests/testsuite/cargo_add/features_unknown/out/Cargo.toml new file mode 100644 index 0000000..3ecdb66 --- /dev/null +++ b/tests/testsuite/cargo_add/features_unknown/out/Cargo.toml @@ -0,0 +1,5 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" diff --git a/tests/testsuite/cargo_add/features_unknown/stderr.log b/tests/testsuite/cargo_add/features_unknown/stderr.log new file mode 100644 index 0000000..58afcb6 --- /dev/null +++ b/tests/testsuite/cargo_add/features_unknown/stderr.log @@ -0,0 +1,5 @@ + Updating `dummy-registry` index + Adding your-face v99999.0.0 to dependencies. +error: unrecognized feature for crate your-face: noze +disabled features: + ears, eyes, mouth, nose diff --git a/tests/testsuite/cargo_add/features_unknown/stdout.log b/tests/testsuite/cargo_add/features_unknown/stdout.log new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/testsuite/cargo_add/features_unknown/stdout.log |