summaryrefslogtreecommitdiffstats
path: root/src/tools/cargo/tests/testsuite/cargo_remove
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/cargo/tests/testsuite/cargo_remove')
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_remove/help/stdout.log6
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_remove/invalid_dep/stderr.log2
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_remove/invalid_section/stderr.log2
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_remove/invalid_section_dep/stderr.log2
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_remove/invalid_target/stderr.log2
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_remove/invalid_target_dep/stderr.log2
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_remove/mod.rs1
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_remove/multiple_dev/out/Cargo.toml2
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature/out/Cargo.toml2
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature_formatting/in/Cargo.toml42
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature_formatting/in/src/lib.rs1
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature_formatting/mod.rs35
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature_formatting/out/Cargo.toml40
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature_formatting/stderr.log2
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature_formatting/stdout.log0
15 files changed, 131 insertions, 10 deletions
diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_remove/help/stdout.log
index 8937fb9f3..47d2c87ad 100644
--- a/src/tools/cargo/tests/testsuite/cargo_remove/help/stdout.log
+++ b/src/tools/cargo/tests/testsuite/cargo_remove/help/stdout.log
@@ -15,9 +15,9 @@ Options:
-h, --help Print help
Section:
- --dev Remove as development dependency
- --build Remove as build dependency
- --target <TARGET> Remove as dependency from the given target platform
+ --dev Remove from dev-dependencies
+ --build Remove from build-dependencies
+ --target <TARGET> Remove from target-dependencies
Package Selection:
-p, --package [<SPEC>] Package to remove from
diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/invalid_dep/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/invalid_dep/stderr.log
index eea124d65..9bb137d1f 100644
--- a/src/tools/cargo/tests/testsuite/cargo_remove/invalid_dep/stderr.log
+++ b/src/tools/cargo/tests/testsuite/cargo_remove/invalid_dep/stderr.log
@@ -1,2 +1,2 @@
Removing invalid_dependency_name from dependencies
-error: the dependency `invalid_dependency_name` could not be found in `dependencies`.
+error: the dependency `invalid_dependency_name` could not be found in `dependencies`
diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/invalid_section/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/invalid_section/stderr.log
index fff5ff00a..8cbafa98e 100644
--- a/src/tools/cargo/tests/testsuite/cargo_remove/invalid_section/stderr.log
+++ b/src/tools/cargo/tests/testsuite/cargo_remove/invalid_section/stderr.log
@@ -1,2 +1,2 @@
Removing docopt from build-dependencies
-error: the dependency `docopt` could not be found in `build-dependencies`.
+error: the dependency `docopt` could not be found in `build-dependencies`; it is present in `dependencies`
diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/invalid_section_dep/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/invalid_section_dep/stderr.log
index 1926f9577..60c0f8b41 100644
--- a/src/tools/cargo/tests/testsuite/cargo_remove/invalid_section_dep/stderr.log
+++ b/src/tools/cargo/tests/testsuite/cargo_remove/invalid_section_dep/stderr.log
@@ -1,2 +1,2 @@
Removing semver from dev-dependencies
-error: the dependency `semver` could not be found in `dev-dependencies`.
+error: the dependency `semver` could not be found in `dev-dependencies`; it is present in `dependencies`
diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/invalid_target/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/invalid_target/stderr.log
index 5075b80b7..eae9f7887 100644
--- a/src/tools/cargo/tests/testsuite/cargo_remove/invalid_target/stderr.log
+++ b/src/tools/cargo/tests/testsuite/cargo_remove/invalid_target/stderr.log
@@ -1,2 +1,2 @@
Removing dbus from dependencies for target `powerpc-unknown-linux-gnu`
-error: the dependency `dbus` could not be found in `target.powerpc-unknown-linux-gnu.dependencies`.
+error: the dependency `dbus` could not be found in `target.powerpc-unknown-linux-gnu.dependencies`; it is present in `target.x86_64-unknown-linux-gnu.dependencies`
diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/invalid_target_dep/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/invalid_target_dep/stderr.log
index 54bfe085f..635a7bd6c 100644
--- a/src/tools/cargo/tests/testsuite/cargo_remove/invalid_target_dep/stderr.log
+++ b/src/tools/cargo/tests/testsuite/cargo_remove/invalid_target_dep/stderr.log
@@ -1,2 +1,2 @@
Removing toml from dependencies for target `x86_64-unknown-linux-gnu`
-error: the dependency `toml` could not be found in `target.x86_64-unknown-linux-gnu.dependencies`.
+error: the dependency `toml` could not be found in `target.x86_64-unknown-linux-gnu.dependencies`; it is present in `dependencies`
diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/mod.rs b/src/tools/cargo/tests/testsuite/cargo_remove/mod.rs
index 4403e2425..7b9190642 100644
--- a/src/tools/cargo/tests/testsuite/cargo_remove/mod.rs
+++ b/src/tools/cargo/tests/testsuite/cargo_remove/mod.rs
@@ -20,6 +20,7 @@ mod multiple_dev;
mod no_arg;
mod offline;
mod optional_dep_feature;
+mod optional_dep_feature_formatting;
mod optional_feature;
mod package;
mod remove_basic;
diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/multiple_dev/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_remove/multiple_dev/out/Cargo.toml
index d961b2bb1..b435e33eb 100644
--- a/src/tools/cargo/tests/testsuite/cargo_remove/multiple_dev/out/Cargo.toml
+++ b/src/tools/cargo/tests/testsuite/cargo_remove/multiple_dev/out/Cargo.toml
@@ -17,4 +17,4 @@ toml = "0.1"
clippy = "0.4"
[features]
-std = ["semver/std"]
+std = [ "semver/std"]
diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature/out/Cargo.toml
index 63112d334..f9613bd30 100644
--- a/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature/out/Cargo.toml
+++ b/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature/out/Cargo.toml
@@ -20,4 +20,4 @@ clippy = "0.4"
regex = "0.1.1"
[features]
-std = ["semver/std"]
+std = [ "semver/std"]
diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature_formatting/in/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature_formatting/in/Cargo.toml
new file mode 100644
index 000000000..01755d687
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature_formatting/in/Cargo.toml
@@ -0,0 +1,42 @@
+[package]
+name = "cargo-remove-test-fixture"
+version = "0.1.0"
+
+[[bin]]
+name = "main"
+path = "src/main.rs"
+
+[build-dependencies]
+semver = "0.1.0"
+
+[dependencies]
+docopt = { version = "0.6", optional = true }
+rustc-serialize = { version = "0.4", optional = true }
+semver = "0.1"
+toml = { version = "0.1", optional = true }
+clippy = { version = "0.4", optional = true }
+
+[dev-dependencies]
+regex = "0.1.1"
+serde = "1.0.90"
+
+[features]
+std = [
+ # Leading clippy
+ "dep:clippy", # trailing clippy
+
+ # Leading docopt
+ "dep:docopt", # trailing docopt
+
+ # Leading rustc-serialize
+ "dep:rustc-serialize", # trailing rustc-serialize
+
+ # Leading serde/std
+ "serde/std", # trailing serde/std
+
+ # Leading semver/std
+ "semver/std", # trailing semver/std
+
+ # Leading toml
+ "dep:toml", # trailing toml
+]
diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature_formatting/in/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature_formatting/in/src/lib.rs
new file mode 100644
index 000000000..8b1378917
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature_formatting/in/src/lib.rs
@@ -0,0 +1 @@
+
diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature_formatting/mod.rs b/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature_formatting/mod.rs
new file mode 100644
index 000000000..69406387b
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature_formatting/mod.rs
@@ -0,0 +1,35 @@
+use cargo_test_support::compare::assert_ui;
+use cargo_test_support::curr_dir;
+use cargo_test_support::CargoCommand;
+use cargo_test_support::Project;
+
+#[cargo_test]
+fn case() {
+ cargo_test_support::registry::init();
+ cargo_test_support::registry::Package::new("clippy", "0.4.0+my-package").publish();
+ cargo_test_support::registry::Package::new("docopt", "0.6.2+my-package").publish();
+ cargo_test_support::registry::Package::new("regex", "0.1.1+my-package").publish();
+ cargo_test_support::registry::Package::new("rustc-serialize", "0.4.0+my-package").publish();
+ cargo_test_support::registry::Package::new("toml", "0.1.1+my-package").publish();
+ cargo_test_support::registry::Package::new("semver", "0.1.1")
+ .feature("std", &[])
+ .publish();
+ cargo_test_support::registry::Package::new("serde", "1.0.90")
+ .feature("std", &[])
+ .publish();
+
+ let project = Project::from_template(curr_dir!().join("in"));
+ let project_root = project.root();
+ let cwd = &project_root;
+
+ snapbox::cmd::Command::cargo_ui()
+ .arg("remove")
+ .args(["docopt", "toml"])
+ .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_remove/optional_dep_feature_formatting/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature_formatting/out/Cargo.toml
new file mode 100644
index 000000000..0398c8beb
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature_formatting/out/Cargo.toml
@@ -0,0 +1,40 @@
+[package]
+name = "cargo-remove-test-fixture"
+version = "0.1.0"
+
+[[bin]]
+name = "main"
+path = "src/main.rs"
+
+[build-dependencies]
+semver = "0.1.0"
+
+[dependencies]
+rustc-serialize = { version = "0.4", optional = true }
+semver = "0.1"
+clippy = { version = "0.4", optional = true }
+
+[dev-dependencies]
+regex = "0.1.1"
+serde = "1.0.90"
+
+[features]
+std = [
+ # Leading clippy
+ "dep:clippy", # trailing clippy
+
+ # Leading docopt
+ # trailing docopt
+
+ # Leading rustc-serialize
+ "dep:rustc-serialize", # trailing rustc-serialize
+
+ # Leading serde/std
+ "serde/std", # trailing serde/std
+
+ # Leading semver/std
+ "semver/std", # trailing semver/std
+
+ # Leading toml
+ # trailing toml
+]
diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature_formatting/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature_formatting/stderr.log
new file mode 100644
index 000000000..7bceb0f94
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature_formatting/stderr.log
@@ -0,0 +1,2 @@
+ Removing docopt from dependencies
+ Removing toml from dependencies
diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature_formatting/stdout.log b/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature_formatting/stdout.log
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature_formatting/stdout.log