-
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.
Auto merge of #13682 - Flowrey:fixes-13578, r=epage
Maintain sorting of dependency features Fixes #13578
- Loading branch information
Showing
13 changed files
with
199 additions
and
2 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
9 changes: 9 additions & 0 deletions
9
tests/testsuite/cargo_add/preserve_features_sorted/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,9 @@ | ||
[workspace] | ||
|
||
[package] | ||
name = "cargo-list-test-fixture" | ||
version = "0.0.0" | ||
edition = "2015" | ||
|
||
[dependencies] | ||
my-package = { version = "99999.0.0", features = ["a", "b", "c", "e"] } |
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,33 @@ | ||
use cargo_test_support::compare::assert_ui; | ||
use cargo_test_support::current_dir; | ||
use cargo_test_support::file; | ||
use cargo_test_support::prelude::*; | ||
use cargo_test_support::str; | ||
use cargo_test_support::Project; | ||
|
||
#[cargo_test] | ||
fn case() { | ||
cargo_test_support::registry::init(); | ||
cargo_test_support::registry::Package::new("my-package", "99999.0.0+my-package") | ||
.feature("a", &[]) | ||
.feature("b", &[]) | ||
.feature("c", &[]) | ||
.feature("d", &[]) | ||
.feature("e", &[]) | ||
.publish(); | ||
|
||
let project = Project::from_template(current_dir!().join("in")); | ||
let project_root = project.root(); | ||
let cwd = &project_root; | ||
|
||
snapbox::cmd::Command::cargo_ui() | ||
.arg("add") | ||
.arg_line("my-package -F d") | ||
.current_dir(cwd) | ||
.assert() | ||
.success() | ||
.stdout_matches(str![""]) | ||
.stderr_matches(file!["stderr.term.svg"]); | ||
|
||
assert_ui().subset_matches(current_dir!().join("out"), &project_root); | ||
} |
9 changes: 9 additions & 0 deletions
9
tests/testsuite/cargo_add/preserve_features_sorted/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,9 @@ | ||
[workspace] | ||
|
||
[package] | ||
name = "cargo-list-test-fixture" | ||
version = "0.0.0" | ||
edition = "2015" | ||
|
||
[dependencies] | ||
my-package = { version = "99999.0.0", features = ["a", "b", "c", "d", "e"] } |
43 changes: 43 additions & 0 deletions
43
tests/testsuite/cargo_add/preserve_features_sorted/stderr.term.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions
9
tests/testsuite/cargo_add/preserve_features_unsorted/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,9 @@ | ||
[workspace] | ||
|
||
[package] | ||
name = "cargo-list-test-fixture" | ||
version = "0.0.0" | ||
edition = "2015" | ||
|
||
[dependencies] | ||
my-package = { version = "99999.0.0", features = ["b", "a", "d", "c"] } |
Empty file.
33 changes: 33 additions & 0 deletions
33
tests/testsuite/cargo_add/preserve_features_unsorted/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,33 @@ | ||
use cargo_test_support::compare::assert_ui; | ||
use cargo_test_support::current_dir; | ||
use cargo_test_support::file; | ||
use cargo_test_support::prelude::*; | ||
use cargo_test_support::str; | ||
use cargo_test_support::Project; | ||
|
||
#[cargo_test] | ||
fn case() { | ||
cargo_test_support::registry::init(); | ||
cargo_test_support::registry::Package::new("my-package", "99999.0.0+my-package") | ||
.feature("a", &[]) | ||
.feature("b", &[]) | ||
.feature("c", &[]) | ||
.feature("d", &[]) | ||
.feature("e", &[]) | ||
.publish(); | ||
|
||
let project = Project::from_template(current_dir!().join("in")); | ||
let project_root = project.root(); | ||
let cwd = &project_root; | ||
|
||
snapbox::cmd::Command::cargo_ui() | ||
.arg("add") | ||
.arg_line("my-package -F e") | ||
.current_dir(cwd) | ||
.assert() | ||
.success() | ||
.stdout_matches(str![""]) | ||
.stderr_matches(file!["stderr.term.svg"]); | ||
|
||
assert_ui().subset_matches(current_dir!().join("out"), &project_root); | ||
} |
9 changes: 9 additions & 0 deletions
9
tests/testsuite/cargo_add/preserve_features_unsorted/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,9 @@ | ||
[workspace] | ||
|
||
[package] | ||
name = "cargo-list-test-fixture" | ||
version = "0.0.0" | ||
edition = "2015" | ||
|
||
[dependencies] | ||
my-package = { version = "99999.0.0", features = ["b", "a", "d", "c", "e"] } |
43 changes: 43 additions & 0 deletions
43
tests/testsuite/cargo_add/preserve_features_unsorted/stderr.term.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.