Skip to content

Commit 253a944

Browse files
committed
test(remove): Add a more extensive formatting test
1 parent 5fab767 commit 253a944

File tree

6 files changed

+61
-0
lines changed

6 files changed

+61
-0
lines changed

tests/testsuite/cargo_remove/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ mod multiple_dev;
2020
mod no_arg;
2121
mod offline;
2222
mod optional_dep_feature;
23+
mod optional_dep_feature_formatting;
2324
mod optional_feature;
2425
mod package;
2526
mod remove_basic;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../remove-basic.in/
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
use cargo_test_support::compare::assert_ui;
2+
use cargo_test_support::curr_dir;
3+
use cargo_test_support::CargoCommand;
4+
use cargo_test_support::Project;
5+
6+
#[cargo_test]
7+
fn case() {
8+
cargo_test_support::registry::init();
9+
cargo_test_support::registry::Package::new("clippy", "0.4.0+my-package").publish();
10+
cargo_test_support::registry::Package::new("docopt", "0.6.2+my-package").publish();
11+
cargo_test_support::registry::Package::new("regex", "0.1.1+my-package").publish();
12+
cargo_test_support::registry::Package::new("rustc-serialize", "0.4.0+my-package").publish();
13+
cargo_test_support::registry::Package::new("toml", "0.1.1+my-package").publish();
14+
cargo_test_support::registry::Package::new("semver", "0.1.1")
15+
.feature("std", &[])
16+
.publish();
17+
cargo_test_support::registry::Package::new("serde", "1.0.90")
18+
.feature("std", &[])
19+
.publish();
20+
21+
let project = Project::from_template(curr_dir!().join("in"));
22+
let project_root = project.root();
23+
let cwd = &project_root;
24+
25+
snapbox::cmd::Command::cargo_ui()
26+
.arg("remove")
27+
.args(["--dev", "serde"])
28+
.current_dir(cwd)
29+
.assert()
30+
.success()
31+
.stdout_matches_path(curr_dir!().join("stdout.log"))
32+
.stderr_matches_path(curr_dir!().join("stderr.log"));
33+
34+
assert_ui().subset_matches(curr_dir!().join("out"), &project_root);
35+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[package]
2+
name = "cargo-remove-test-fixture"
3+
version = "0.1.0"
4+
5+
[[bin]]
6+
name = "main"
7+
path = "src/main.rs"
8+
9+
[build-dependencies]
10+
semver = "0.1.0"
11+
12+
[dependencies]
13+
docopt = "0.6"
14+
rustc-serialize = "0.4"
15+
semver = "0.1"
16+
toml = "0.1"
17+
clippy = "0.4"
18+
19+
[dev-dependencies]
20+
regex = "0.1.1"
21+
22+
[features]
23+
std = ["semver/std"]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Removing serde from dev-dependencies

tests/testsuite/cargo_remove/optional_dep_feature_formatting/stdout.log

Whitespace-only changes.

0 commit comments

Comments
 (0)