mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
test(add): Check table formatting issues
This commit is contained in:
parent
5fab767241
commit
716ae6238f
@ -99,6 +99,7 @@ mod path_dev;
|
||||
mod path_inferred_name;
|
||||
mod path_inferred_name_conflicts_full_feature;
|
||||
mod path_normalized_name;
|
||||
mod preserve_dep_std_table;
|
||||
mod preserve_features_table;
|
||||
mod preserve_sorted;
|
||||
mod preserve_unsorted;
|
||||
|
@ -0,0 +1,14 @@
|
||||
[package]
|
||||
name = "xxx"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies.your-face]
|
||||
# Leading version
|
||||
version = "99999.0.0" # Trailing version
|
||||
# Leading optional
|
||||
optional = true # Trailing optional
|
||||
# Leading features
|
||||
features = [] # Trailing features
|
31
tests/testsuite/cargo_add/preserve_dep_std_table/mod.rs
Normal file
31
tests/testsuite/cargo_add/preserve_dep_std_table/mod.rs
Normal file
@ -0,0 +1,31 @@
|
||||
use cargo_test_support::compare::assert_ui;
|
||||
use cargo_test_support::prelude::*;
|
||||
use cargo_test_support::Project;
|
||||
|
||||
use cargo_test_support::curr_dir;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
cargo_test_support::registry::init();
|
||||
cargo_test_support::registry::Package::new("your-face", "99999.0.0+my-package")
|
||||
.feature("nose", &[])
|
||||
.feature("mouth", &[])
|
||||
.feature("eyes", &[])
|
||||
.feature("ears", &[])
|
||||
.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("add")
|
||||
.arg_line("your-face --no-optional")
|
||||
.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);
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
[package]
|
||||
name = "xxx"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies.your-face]
|
||||
version = "99999.0.0"
|
||||
features = []
|
@ -0,0 +1,7 @@
|
||||
Updating `dummy-registry` index
|
||||
Adding your-face v99999.0.0 to dependencies.
|
||||
Features:
|
||||
- ears
|
||||
- eyes
|
||||
- mouth
|
||||
- nose
|
Loading…
x
Reference in New Issue
Block a user