Skip to content

Commit b7b036f

Browse files
committed
Chore(test): remove unnecesary packages and versions for optionals tests
1 parent 9e9349d commit b7b036f

File tree

25 files changed

+30
-129
lines changed

25 files changed

+30
-129
lines changed

tests/testsuite/cargo_add/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ mod overwrite_no_public;
8787
mod overwrite_no_public_with_public;
8888
mod overwrite_optional;
8989
mod overwrite_optional_with_no_optional;
90+
mod overwrite_optional_with_optional;
9091
mod overwrite_path_noop;
9192
mod overwrite_path_with_version;
9293
mod overwrite_preserves_inline_table;

tests/testsuite/cargo_add/no_optional/mod.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,15 @@ use cargo_test_support::curr_dir;
77
#[cargo_test]
88
fn case() {
99
cargo_test_support::registry::init();
10-
for name in ["my-package1", "my-package2"] {
11-
for ver in [
12-
"0.1.1+my-package",
13-
"0.2.0+my-package",
14-
"0.2.3+my-package",
15-
"0.4.1+my-package",
16-
"20.0.0+my-package",
17-
"99999.0.0+my-package",
18-
"99999.0.0-alpha.1+my-package",
19-
] {
20-
cargo_test_support::registry::Package::new(name, ver).publish();
21-
}
22-
}
10+
cargo_test_support::registry::Package::new("my-package", "0.1.0").publish();
2311

2412
let project = Project::from_template(curr_dir!().join("in"));
2513
let project_root = project.root();
2614
let cwd = &project_root;
2715

2816
snapbox::cmd::Command::cargo_ui()
2917
.arg("add")
30-
.arg_line("my-package1 [email protected] --no-optional")
18+
.arg_line("my-package --no-optional")
3119
.current_dir(cwd)
3220
.assert()
3321
.success()

tests/testsuite/cargo_add/no_optional/out/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ name = "cargo-list-test-fixture"
55
version = "0.0.0"
66

77
[dependencies]
8-
my-package1 = "99999.0.0"
9-
my-package2 = "0.4.1"
8+
my-package = "0.1.0"
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
Updating `dummy-registry` index
2-
Adding my-package1 v99999.0.0 to dependencies.
3-
Adding my-package2 v0.4.1 to dependencies.
2+
Adding my-package v0.1.0 to dependencies.

tests/testsuite/cargo_add/optional/mod.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,15 @@ use cargo_test_support::curr_dir;
77
#[cargo_test]
88
fn case() {
99
cargo_test_support::registry::init();
10-
for name in ["my-package1", "my-package2"] {
11-
for ver in [
12-
"0.1.1+my-package",
13-
"0.2.0+my-package",
14-
"0.2.3+my-package",
15-
"0.4.1+my-package",
16-
"20.0.0+my-package",
17-
"99999.0.0+my-package",
18-
"99999.0.0-alpha.1+my-package",
19-
] {
20-
cargo_test_support::registry::Package::new(name, ver).publish();
21-
}
22-
}
10+
cargo_test_support::registry::Package::new("my-package", "0.1.0").publish();
2311

2412
let project = Project::from_template(curr_dir!().join("in"));
2513
let project_root = project.root();
2614
let cwd = &project_root;
2715

2816
snapbox::cmd::Command::cargo_ui()
2917
.arg("add")
30-
.arg_line("my-package1 [email protected] --optional")
18+
.arg_line("my-package --optional")
3119
.current_dir(cwd)
3220
.assert()
3321
.success()

tests/testsuite/cargo_add/optional/out/Cargo.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ name = "cargo-list-test-fixture"
55
version = "0.0.0"
66

77
[dependencies]
8-
my-package1 = { version = "99999.0.0", optional = true }
9-
my-package2 = { version = "0.4.1", optional = true }
8+
my-package = { version = "0.1.0", optional = true }
109

1110
[features]
12-
my-package1 = ["dep:my-package1"]
13-
my-package2 = ["dep:my-package2"]
11+
my-package = ["dep:my-package"]
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
Updating `dummy-registry` index
2-
Adding my-package1 v99999.0.0 to optional dependencies.
3-
Adding my-package2 v0.4.1 to optional dependencies.
2+
Adding my-package v0.1.0 to optional dependencies.

tests/testsuite/cargo_add/overwrite_no_optional/in/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ name = "cargo-list-test-fixture"
55
version = "0.0.0"
66

77
[dependencies]
8-
my-package1 = "99999.0.0"
9-
my-package2 = "0.4.1"
8+
my-package = "0.1.0"

tests/testsuite/cargo_add/overwrite_no_optional/mod.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,15 @@ use cargo_test_support::curr_dir;
77
#[cargo_test]
88
fn case() {
99
cargo_test_support::registry::init();
10-
for name in ["my-package1", "my-package2"] {
11-
for ver in [
12-
"0.1.1+my-package",
13-
"0.2.0+my-package",
14-
"0.2.3+my-package",
15-
"0.4.1+my-package",
16-
"20.0.0+my-package",
17-
"99999.0.0+my-package",
18-
"99999.0.0-alpha.1+my-package",
19-
] {
20-
cargo_test_support::registry::Package::new(name, ver).publish();
21-
}
22-
}
10+
cargo_test_support::registry::Package::new("my-package", "0.1.0").publish();
2311

2412
let project = Project::from_template(curr_dir!().join("in"));
2513
let project_root = project.root();
2614
let cwd = &project_root;
2715

2816
snapbox::cmd::Command::cargo_ui()
2917
.arg("add")
30-
.arg_line("my-package1 [email protected] --no-optional")
18+
.arg_line("my-package --no-optional")
3119
.current_dir(cwd)
3220
.assert()
3321
.success()

tests/testsuite/cargo_add/overwrite_no_optional/out/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ name = "cargo-list-test-fixture"
55
version = "0.0.0"
66

77
[dependencies]
8-
my-package1 = "99999.0.0"
9-
my-package2 = "0.4.1"
8+
my-package = "0.1.0"
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
Updating `dummy-registry` index
2-
Adding my-package1 v99999.0.0 to dependencies.
3-
Adding my-package2 v0.4.1 to dependencies.
2+
Adding my-package v0.1.0 to dependencies.

tests/testsuite/cargo_add/overwrite_no_optional_with_optional/in/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ name = "cargo-list-test-fixture"
55
version = "0.0.0"
66

77
[dependencies]
8-
my-package1 = { version = "99999.0.0", optional = false }
9-
my-package2 = { version = "0.4.1", optional = false }
8+
my-package = { version = "0.1.0", optional = false }

tests/testsuite/cargo_add/overwrite_no_optional_with_optional/mod.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,15 @@ use cargo_test_support::curr_dir;
77
#[cargo_test]
88
fn case() {
99
cargo_test_support::registry::init();
10-
for name in ["my-package1", "my-package2"] {
11-
for ver in [
12-
"0.1.1+my-package",
13-
"0.2.0+my-package",
14-
"0.2.3+my-package",
15-
"0.4.1+my-package",
16-
"20.0.0+my-package",
17-
"99999.0.0+my-package",
18-
"99999.0.0-alpha.1+my-package",
19-
] {
20-
cargo_test_support::registry::Package::new(name, ver).publish();
21-
}
22-
}
10+
cargo_test_support::registry::Package::new("my-package", "0.1.0").publish();
2311

2412
let project = Project::from_template(curr_dir!().join("in"));
2513
let project_root = project.root();
2614
let cwd = &project_root;
2715

2816
snapbox::cmd::Command::cargo_ui()
2917
.arg("add")
30-
.arg_line("my-package1 [email protected] --optional")
18+
.arg_line("my-package --optional")
3119
.current_dir(cwd)
3220
.assert()
3321
.success()

tests/testsuite/cargo_add/overwrite_no_optional_with_optional/out/Cargo.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ name = "cargo-list-test-fixture"
55
version = "0.0.0"
66

77
[dependencies]
8-
my-package1 = { version = "99999.0.0", optional = true }
9-
my-package2 = { version = "0.4.1", optional = true }
8+
my-package = { version = "0.1.0", optional = true }
109

1110
[features]
12-
my-package1 = ["dep:my-package1"]
13-
my-package2 = ["dep:my-package2"]
11+
my-package = ["dep:my-package"]
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
Updating `dummy-registry` index
2-
Adding my-package1 v99999.0.0 to optional dependencies.
3-
Adding my-package2 v0.4.1 to optional dependencies.
2+
Adding my-package v0.1.0 to optional dependencies.

tests/testsuite/cargo_add/overwrite_optional/in/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ name = "cargo-list-test-fixture"
55
version = "0.0.0"
66

77
[dependencies]
8-
my-package1 = "99999.0.0"
9-
my-package2 = "0.4.1"
8+
my-package = "0.1.0"

tests/testsuite/cargo_add/overwrite_optional/mod.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,15 @@ use cargo_test_support::curr_dir;
77
#[cargo_test]
88
fn case() {
99
cargo_test_support::registry::init();
10-
for name in ["my-package1", "my-package2"] {
11-
for ver in [
12-
"0.1.1+my-package",
13-
"0.2.0+my-package",
14-
"0.2.3+my-package",
15-
"0.4.1+my-package",
16-
"20.0.0+my-package",
17-
"99999.0.0+my-package",
18-
"99999.0.0-alpha.1+my-package",
19-
] {
20-
cargo_test_support::registry::Package::new(name, ver).publish();
21-
}
22-
}
10+
cargo_test_support::registry::Package::new("my-package", "0.1.0").publish();
2311

2412
let project = Project::from_template(curr_dir!().join("in"));
2513
let project_root = project.root();
2614
let cwd = &project_root;
2715

2816
snapbox::cmd::Command::cargo_ui()
2917
.arg("add")
30-
.arg_line("my-package1 [email protected] --optional")
18+
.arg_line("my-package --optional")
3119
.current_dir(cwd)
3220
.assert()
3321
.success()

tests/testsuite/cargo_add/overwrite_optional/out/Cargo.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ name = "cargo-list-test-fixture"
55
version = "0.0.0"
66

77
[dependencies]
8-
my-package1 = { version = "99999.0.0", optional = true }
9-
my-package2 = { version = "0.4.1", optional = true }
8+
my-package = { version = "0.1.0", optional = true }
109

1110
[features]
12-
my-package1 = ["dep:my-package1"]
13-
my-package2 = ["dep:my-package2"]
11+
my-package = ["dep:my-package"]
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
Updating `dummy-registry` index
2-
Adding my-package1 v99999.0.0 to optional dependencies.
3-
Adding my-package2 v0.4.1 to optional dependencies.
2+
Adding my-package v0.1.0 to optional dependencies.

tests/testsuite/cargo_add/overwrite_optional_with_no_optional/in/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ other = ["your-face/nose"]
1010

1111
[dependencies]
1212
your-face = { version = "99999.0.0", optional = true }
13-
my-package2 = { version = "0.4.1", optional = true }

tests/testsuite/cargo_add/overwrite_optional_with_no_optional/mod.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,7 @@ use cargo_test_support::curr_dir;
77
#[cargo_test]
88
fn case() {
99
cargo_test_support::registry::init();
10-
for ver in [
11-
"0.1.1+my-package",
12-
"0.2.0+my-package",
13-
"0.2.3+my-package",
14-
"0.4.1+my-package",
15-
"20.0.0+my-package",
16-
"99999.0.0+my-package",
17-
"99999.0.0-alpha.1+my-package",
18-
] {
19-
cargo_test_support::registry::Package::new("my-package2", ver).publish();
20-
}
10+
2111
cargo_test_support::registry::Package::new("your-face", "99999.0.0+my-package")
2212
.feature("nose", &[])
2313
.feature("mouth", &[])
@@ -31,7 +21,7 @@ fn case() {
3121

3222
snapbox::cmd::Command::cargo_ui()
3323
.arg("add")
34-
.arg_line("your-face [email protected] --no-optional")
24+
.arg_line("your-face --no-optional")
3525
.current_dir(cwd)
3626
.assert()
3727
.success()

tests/testsuite/cargo_add/overwrite_optional_with_no_optional/out/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ other = ["your-face/nose"]
1010

1111
[dependencies]
1212
your-face = { version = "99999.0.0" }
13-
my-package2 = { version = "0.4.1" }

tests/testsuite/cargo_add/overwrite_optional_with_no_optional/stderr.log

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@
55
- eyes
66
- mouth
77
- nose
8-
Adding my-package2 v0.4.1 to dependencies.

tests/testsuite/cargo_add/overwrite_optional_with_optional/mod.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,7 @@ use cargo_test_support::curr_dir;
77
#[cargo_test]
88
fn case() {
99
cargo_test_support::registry::init();
10-
for ver in [
11-
"0.1.1+my-package",
12-
"0.2.0+my-package",
13-
"0.2.3+my-package",
14-
"0.4.1+my-package",
15-
"20.0.0+my-package",
16-
"99999.0.0+my-package",
17-
"99999.0.0-alpha.1+my-package",
18-
] {
19-
cargo_test_support::registry::Package::new("my-package1", ver).publish();
20-
}
10+
cargo_test_support::registry::Package::new("my-package1", "99999.0.0").publish();
2111

2212
let project = Project::from_template(curr_dir!().join("in"));
2313
let project_root = project.root();
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
Updating `dummy-registry` index
22
Adding my-package1 v99999.0.0 to optional dependencies.
3-
Adding my-package2 v0.4.1 to optional dependencies.

0 commit comments

Comments
 (0)