This repository has been archived by the owner on Aug 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from hi-rustin/rustin-patch-spec
feat: allow version selection
- Loading branch information
Showing
36 changed files
with
339 additions
and
23 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
19 changes: 19 additions & 0 deletions
19
tests/testsuite/cargo_information/specify_version_outside_workspace/mod.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,19 @@ | ||
use cargo_test_macro::cargo_test; | ||
use cargo_test_support::curr_dir; | ||
|
||
use super::{cargo_info, init_registry_without_token}; | ||
|
||
#[cargo_test] | ||
fn case() { | ||
init_registry_without_token(); | ||
for ver in ["0.1.1+my-package", "0.2.0+my-package", "0.2.3+my-package"] { | ||
cargo_test_support::registry::Package::new("my-package", ver).publish(); | ||
} | ||
cargo_info() | ||
.arg("my-package@0.2") | ||
.arg("--registry=dummy-registry") | ||
.assert() | ||
.success() | ||
.stdout_matches_path(curr_dir!().join("stdout.log")) | ||
.stderr_matches_path(curr_dir!().join("stderr.log")); | ||
} |
3 changes: 3 additions & 0 deletions
3
tests/testsuite/cargo_information/specify_version_outside_workspace/stderr.log
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,3 @@ | ||
Updating `dummy-registry` index | ||
Downloading crates ... | ||
Downloaded my-package v0.2.3+my-package (registry `dummy-registry`) |
4 changes: 4 additions & 0 deletions
4
tests/testsuite/cargo_information/specify_version_outside_workspace/stdout.log
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,4 @@ | ||
my-package | ||
version: 0.2.3+my-package | ||
license: unknown | ||
rust-version: unknown |
29 changes: 29 additions & 0 deletions
29
...suite/cargo_information/specify_version_with_ws_and_match_multiple_versions/in/Cargo.lock
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
...suite/cargo_information/specify_version_with_ws_and_match_multiple_versions/in/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 = ["crate*"] |
6 changes: 6 additions & 0 deletions
6
...argo_information/specify_version_with_ws_and_match_multiple_versions/in/crate1/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 = "crate1" | ||
version = "0.0.0" | ||
|
||
[dependencies] | ||
my-package = "=0.2.0+my-package" |
Empty file.
6 changes: 6 additions & 0 deletions
6
...argo_information/specify_version_with_ws_and_match_multiple_versions/in/crate2/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 = "crate2" | ||
version = "0.0.0" | ||
|
||
[dependencies] | ||
my-package = "=0.2.3+my-package" |
Empty file.
32 changes: 32 additions & 0 deletions
32
tests/testsuite/cargo_information/specify_version_with_ws_and_match_multiple_versions/mod.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,32 @@ | ||
use cargo_test_macro::cargo_test; | ||
use cargo_test_support::{compare::assert_ui, curr_dir, Project}; | ||
|
||
use super::{cargo_info, init_registry_without_token}; | ||
|
||
#[cargo_test] | ||
fn case() { | ||
init_registry_without_token(); | ||
for ver in [ | ||
"0.1.1+my-package", | ||
"0.2.0+my-package", | ||
"0.2.3+my-package", | ||
"0.4.1+my-package", | ||
] { | ||
cargo_test_support::registry::Package::new("my-package", ver).publish(); | ||
} | ||
|
||
let project = Project::from_template(curr_dir!().join("in")); | ||
let project_root = project.root(); | ||
let cwd = &project_root; | ||
|
||
cargo_info() | ||
.arg("my-package@0.2") | ||
.arg("--registry=dummy-registry") | ||
.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); | ||
} |
29 changes: 29 additions & 0 deletions
29
...uite/cargo_information/specify_version_with_ws_and_match_multiple_versions/out/Cargo.lock
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
...uite/cargo_information/specify_version_with_ws_and_match_multiple_versions/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 = ["crate*"] |
6 changes: 6 additions & 0 deletions
6
...rgo_information/specify_version_with_ws_and_match_multiple_versions/out/crate1/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 = "crate1" | ||
version = "0.0.0" | ||
|
||
[dependencies] | ||
my-package = "=0.2.0+my-package" |
Empty file.
6 changes: 6 additions & 0 deletions
6
...rgo_information/specify_version_with_ws_and_match_multiple_versions/out/crate2/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 = "crate2" | ||
version = "0.0.0" | ||
|
||
[dependencies] | ||
my-package = "=0.2.3+my-package" |
Empty file.
4 changes: 4 additions & 0 deletions
4
...estsuite/cargo_information/specify_version_with_ws_and_match_multiple_versions/stderr.log
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,4 @@ | ||
Updating `dummy-registry` index | ||
Downloading crates ... | ||
Downloaded my-package v0.2.3+my-package (registry `dummy-registry`) | ||
Updating crates.io index |
6 changes: 6 additions & 0 deletions
6
...estsuite/cargo_information/specify_version_with_ws_and_match_multiple_versions/stdout.log
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 @@ | ||
my-package | ||
version: 0.2.3+my-package (latest 0.4.1+my-package) | ||
license: unknown | ||
rust-version: unknown | ||
documentation: https://docs.rs/my-package/0.2.3+my-package | ||
note: to see how you depend on my-package, run `cargo tree --package my-package@0.2.3+my-package --invert` |
1 change: 1 addition & 0 deletions
1
tests/testsuite/cargo_information/specify_version_within_ws_and_conflict_with_lockfile/in
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 @@ | ||
../within_workspace.in |
35 changes: 35 additions & 0 deletions
35
...s/testsuite/cargo_information/specify_version_within_ws_and_conflict_with_lockfile/mod.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,35 @@ | ||
use cargo_test_macro::cargo_test; | ||
use cargo_test_support::{compare::assert_ui, curr_dir, Project}; | ||
|
||
use super::{cargo_info, init_registry_without_token}; | ||
|
||
#[cargo_test] | ||
fn case() { | ||
init_registry_without_token(); | ||
for ver in [ | ||
"0.1.1+my-package", | ||
"0.2.0+my-package", | ||
"0.2.3+my-package", | ||
"0.4.1+my-package", | ||
"20.0.0+my-package", | ||
"99999.0.0+my-package", | ||
"99999.0.0-alpha.1+my-package", | ||
] { | ||
cargo_test_support::registry::Package::new("my-package", ver).publish(); | ||
} | ||
|
||
let project = Project::from_template(curr_dir!().join("in")); | ||
let project_root = project.root(); | ||
let cwd = &project_root; | ||
|
||
cargo_info() | ||
.arg("my-package@0.4") | ||
.arg("--registry=dummy-registry") | ||
.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); | ||
} |
16 changes: 16 additions & 0 deletions
16
...ite/cargo_information/specify_version_within_ws_and_conflict_with_lockfile/out/Cargo.lock
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
...ite/cargo_information/specify_version_within_ws_and_conflict_with_lockfile/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,8 @@ | ||
[workspace] | ||
|
||
[package] | ||
name = "cargo-list-test-fixture" | ||
version = "0.0.0" | ||
|
||
[dependencies] | ||
my-package = "0.1" |
1 change: 1 addition & 0 deletions
1
...ite/cargo_information/specify_version_within_ws_and_conflict_with_lockfile/out/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 @@ | ||
|
3 changes: 3 additions & 0 deletions
3
...stsuite/cargo_information/specify_version_within_ws_and_conflict_with_lockfile/stderr.log
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,3 @@ | ||
Updating `dummy-registry` index | ||
Downloading crates ... | ||
Downloaded my-package v0.4.1+my-package (registry `dummy-registry`) |
4 changes: 4 additions & 0 deletions
4
...stsuite/cargo_information/specify_version_within_ws_and_conflict_with_lockfile/stdout.log
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,4 @@ | ||
my-package | ||
version: 0.4.1+my-package (latest 99999.0.0+my-package) | ||
license: unknown | ||
rust-version: unknown |
1 change: 1 addition & 0 deletions
1
tests/testsuite/cargo_information/specify_version_within_ws_and_match_with_lockfile/in
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 @@ | ||
../within_workspace.in |
Oops, something went wrong.