-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up workspace dependencies after cargo remove
- Loading branch information
1 parent
b592ba4
commit 2fb096b
Showing
22 changed files
with
268 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[workspace] | ||
members = [ "my-package" ] | ||
|
||
[workspace.dependencies] | ||
semver = "0.1.0" |
24 changes: 24 additions & 0 deletions
24
tests/testsuite/cargo_remove/virtual_workspace/in/my-package/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[package] | ||
name = "my-package" | ||
version = "0.1.0" | ||
|
||
[[bin]] | ||
name = "main" | ||
path = "src/main.rs" | ||
|
||
[build-dependencies] | ||
semver = { workspace = true } | ||
|
||
[dependencies] | ||
docopt = "0.6" | ||
rustc-serialize = "0.4" | ||
semver = "0.1" | ||
toml = "0.1" | ||
clippy = "0.4" | ||
|
||
[dev-dependencies] | ||
regex = "0.1.1" | ||
serde = "1.0.90" | ||
|
||
[features] | ||
std = ["serde/std", "semver/std"] |
1 change: 1 addition & 0 deletions
1
tests/testsuite/cargo_remove/virtual_workspace/in/my-package/src/lib.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use cargo_test_support::compare::assert_ui; | ||
use cargo_test_support::curr_dir; | ||
use cargo_test_support::CargoCommand; | ||
use cargo_test_support::Project; | ||
|
||
use crate::cargo_remove::init_registry; | ||
|
||
#[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("remove") | ||
.args(["--package", "my-package", "--build", "semver"]) | ||
.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); | ||
} |
2 changes: 2 additions & 0 deletions
2
tests/testsuite/cargo_remove/virtual_workspace/out/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[workspace] | ||
members = [ "my-package" ] |
21 changes: 21 additions & 0 deletions
21
tests/testsuite/cargo_remove/virtual_workspace/out/my-package/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[package] | ||
name = "my-package" | ||
version = "0.1.0" | ||
|
||
[[bin]] | ||
name = "main" | ||
path = "src/main.rs" | ||
|
||
[dependencies] | ||
docopt = "0.6" | ||
rustc-serialize = "0.4" | ||
semver = "0.1" | ||
toml = "0.1" | ||
clippy = "0.4" | ||
|
||
[dev-dependencies] | ||
regex = "0.1.1" | ||
serde = "1.0.90" | ||
|
||
[features] | ||
std = ["serde/std", "semver/std"] |
1 change: 1 addition & 0 deletions
1
tests/testsuite/cargo_remove/virtual_workspace/out/my-package/src/lib.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Removing semver from build-dependencies | ||
Updating `dummy-registry` index |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[workspace] | ||
members = [ "my-member" ] | ||
|
||
[workspace.dependencies] | ||
semver = "0.1.0" | ||
|
||
[package] | ||
name = "my-package" | ||
version = "0.1.0" | ||
|
||
[[bin]] | ||
name = "main" | ||
path = "src/main.rs" | ||
|
||
[build-dependencies] | ||
semver = { workspace = true } | ||
|
||
[dependencies] | ||
docopt = "0.6" | ||
rustc-serialize = "0.4" | ||
semver = "0.1" | ||
toml = "0.1" | ||
clippy = "0.4" | ||
|
||
[dev-dependencies] | ||
regex = "0.1.1" | ||
serde = "1.0.90" | ||
|
||
[features] | ||
std = ["serde/std", "semver/std"] |
6 changes: 6 additions & 0 deletions
6
tests/testsuite/cargo_remove/workspace/in/my-member/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[package] | ||
name = "my-member" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use cargo_test_support::compare::assert_ui; | ||
use cargo_test_support::curr_dir; | ||
use cargo_test_support::CargoCommand; | ||
use cargo_test_support::Project; | ||
|
||
use crate::cargo_remove::init_registry; | ||
|
||
#[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("remove") | ||
.args(["--package", "my-package", "--build", "semver"]) | ||
.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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[workspace] | ||
members = [ "my-member" ] | ||
|
||
[package] | ||
name = "my-package" | ||
version = "0.1.0" | ||
|
||
[[bin]] | ||
name = "main" | ||
path = "src/main.rs" | ||
|
||
[dependencies] | ||
docopt = "0.6" | ||
rustc-serialize = "0.4" | ||
semver = "0.1" | ||
toml = "0.1" | ||
clippy = "0.4" | ||
|
||
[dev-dependencies] | ||
regex = "0.1.1" | ||
serde = "1.0.90" | ||
|
||
[features] | ||
std = ["serde/std", "semver/std"] |
6 changes: 6 additions & 0 deletions
6
tests/testsuite/cargo_remove/workspace/out/my-member/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[package] | ||
name = "my-member" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Removing semver from build-dependencies | ||
Updating `dummy-registry` index |
Empty file.