Skip to content

Commit 716ae62

Browse files
committed
test(add): Check table formatting issues
1 parent 5fab767 commit 716ae62

File tree

7 files changed

+63
-0
lines changed

7 files changed

+63
-0
lines changed

tests/testsuite/cargo_add/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ mod path_dev;
9999
mod path_inferred_name;
100100
mod path_inferred_name_conflicts_full_feature;
101101
mod path_normalized_name;
102+
mod preserve_dep_std_table;
102103
mod preserve_features_table;
103104
mod preserve_sorted;
104105
mod preserve_unsorted;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[package]
2+
name = "xxx"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies.your-face]
9+
# Leading version
10+
version = "99999.0.0" # Trailing version
11+
# Leading optional
12+
optional = true # Trailing optional
13+
# Leading features
14+
features = [] # Trailing features

tests/testsuite/cargo_add/preserve_dep_std_table/in/src/lib.rs

Whitespace-only changes.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
use cargo_test_support::compare::assert_ui;
2+
use cargo_test_support::prelude::*;
3+
use cargo_test_support::Project;
4+
5+
use cargo_test_support::curr_dir;
6+
7+
#[cargo_test]
8+
fn case() {
9+
cargo_test_support::registry::init();
10+
cargo_test_support::registry::Package::new("your-face", "99999.0.0+my-package")
11+
.feature("nose", &[])
12+
.feature("mouth", &[])
13+
.feature("eyes", &[])
14+
.feature("ears", &[])
15+
.publish();
16+
17+
let project = Project::from_template(curr_dir!().join("in"));
18+
let project_root = project.root();
19+
let cwd = &project_root;
20+
21+
snapbox::cmd::Command::cargo_ui()
22+
.arg("add")
23+
.arg_line("your-face --no-optional")
24+
.current_dir(cwd)
25+
.assert()
26+
.success()
27+
.stdout_matches_path(curr_dir!().join("stdout.log"))
28+
.stderr_matches_path(curr_dir!().join("stderr.log"));
29+
30+
assert_ui().subset_matches(curr_dir!().join("out"), &project_root);
31+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[package]
2+
name = "xxx"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies.your-face]
9+
version = "99999.0.0"
10+
features = []
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Updating `dummy-registry` index
2+
Adding your-face v99999.0.0 to dependencies.
3+
Features:
4+
- ears
5+
- eyes
6+
- mouth
7+
- nose

tests/testsuite/cargo_add/preserve_dep_std_table/stdout.log

Whitespace-only changes.

0 commit comments

Comments
 (0)