From f737784fd5d0a96f4198dfbc080a0a5ca45806e1 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 25 Jul 2022 11:03:55 -0500 Subject: [PATCH] test(add): Make test data valid Resolving the manifests will fail due to inconsistencies. This addresses those. --- .../build_prefer_existing_version/in/dependency/Cargo.toml | 4 ++++ .../out/dependency/Cargo.toml | 4 ++++ .../cargo_add/build_prefer_existing_version/stderr.log | 3 +++ .../dev_prefer_existing_version/in/dependency/Cargo.toml | 4 ++++ .../dev_prefer_existing_version/out/dependency/Cargo.toml | 4 ++++ .../cargo_add/dev_prefer_existing_version/stderr.log | 3 +++ .../cargo_add/list_features_path/in/dependency/Cargo.toml | 3 +-- .../cargo_add/list_features_path/in/optional/Cargo.toml | 5 ++--- .../cargo_add/list_features_path/out/dependency/Cargo.toml | 3 +-- .../list_features_path_no_default/in/dependency/Cargo.toml | 3 +-- .../list_features_path_no_default/in/optional/Cargo.toml | 5 ++--- .../out/dependency/Cargo.toml | 3 +-- .../overwrite_optional_with_no_optional/in/Cargo.toml | 6 +++--- .../cargo_add/overwrite_optional_with_no_optional/mod.rs | 2 +- .../overwrite_optional_with_no_optional/out/Cargo.toml | 4 ++-- .../overwrite_optional_with_no_optional/stderr.log | 7 ++++++- tests/testsuite/cargo_add/preserve_sorted/in/Cargo.toml | 4 ++-- tests/testsuite/cargo_add/preserve_sorted/out/Cargo.toml | 4 ++-- tests/testsuite/cargo_add/preserve_unsorted/in/Cargo.toml | 4 ++-- tests/testsuite/cargo_add/preserve_unsorted/out/Cargo.toml | 4 ++-- 20 files changed, 50 insertions(+), 29 deletions(-) diff --git a/tests/testsuite/cargo_add/build_prefer_existing_version/in/dependency/Cargo.toml b/tests/testsuite/cargo_add/build_prefer_existing_version/in/dependency/Cargo.toml index cbe244113c1..58b909ceff0 100644 --- a/tests/testsuite/cargo_add/build_prefer_existing_version/in/dependency/Cargo.toml +++ b/tests/testsuite/cargo_add/build_prefer_existing_version/in/dependency/Cargo.toml @@ -3,3 +3,7 @@ [package] name = "cargo-list-test-fixture-dependency" version = "0.0.0" + +[features] +one = [] +two = [] diff --git a/tests/testsuite/cargo_add/build_prefer_existing_version/out/dependency/Cargo.toml b/tests/testsuite/cargo_add/build_prefer_existing_version/out/dependency/Cargo.toml index cbe244113c1..58b909ceff0 100644 --- a/tests/testsuite/cargo_add/build_prefer_existing_version/out/dependency/Cargo.toml +++ b/tests/testsuite/cargo_add/build_prefer_existing_version/out/dependency/Cargo.toml @@ -3,3 +3,7 @@ [package] name = "cargo-list-test-fixture-dependency" version = "0.0.0" + +[features] +one = [] +two = [] diff --git a/tests/testsuite/cargo_add/build_prefer_existing_version/stderr.log b/tests/testsuite/cargo_add/build_prefer_existing_version/stderr.log index 00f39cd5b98..554aa2ef31d 100644 --- a/tests/testsuite/cargo_add/build_prefer_existing_version/stderr.log +++ b/tests/testsuite/cargo_add/build_prefer_existing_version/stderr.log @@ -1 +1,4 @@ Adding cargo-list-test-fixture-dependency (local) to build-dependencies. + Features: + - one + - two diff --git a/tests/testsuite/cargo_add/dev_prefer_existing_version/in/dependency/Cargo.toml b/tests/testsuite/cargo_add/dev_prefer_existing_version/in/dependency/Cargo.toml index cbe244113c1..58b909ceff0 100644 --- a/tests/testsuite/cargo_add/dev_prefer_existing_version/in/dependency/Cargo.toml +++ b/tests/testsuite/cargo_add/dev_prefer_existing_version/in/dependency/Cargo.toml @@ -3,3 +3,7 @@ [package] name = "cargo-list-test-fixture-dependency" version = "0.0.0" + +[features] +one = [] +two = [] diff --git a/tests/testsuite/cargo_add/dev_prefer_existing_version/out/dependency/Cargo.toml b/tests/testsuite/cargo_add/dev_prefer_existing_version/out/dependency/Cargo.toml index cbe244113c1..58b909ceff0 100644 --- a/tests/testsuite/cargo_add/dev_prefer_existing_version/out/dependency/Cargo.toml +++ b/tests/testsuite/cargo_add/dev_prefer_existing_version/out/dependency/Cargo.toml @@ -3,3 +3,7 @@ [package] name = "cargo-list-test-fixture-dependency" version = "0.0.0" + +[features] +one = [] +two = [] diff --git a/tests/testsuite/cargo_add/dev_prefer_existing_version/stderr.log b/tests/testsuite/cargo_add/dev_prefer_existing_version/stderr.log index d8093d6aece..06673543a9f 100644 --- a/tests/testsuite/cargo_add/dev_prefer_existing_version/stderr.log +++ b/tests/testsuite/cargo_add/dev_prefer_existing_version/stderr.log @@ -1 +1,4 @@ Adding cargo-list-test-fixture-dependency (local) to dev-dependencies. + Features: + - one + - two diff --git a/tests/testsuite/cargo_add/list_features_path/in/dependency/Cargo.toml b/tests/testsuite/cargo_add/list_features_path/in/dependency/Cargo.toml index 34157f41182..18041a53fd6 100644 --- a/tests/testsuite/cargo_add/list_features_path/in/dependency/Cargo.toml +++ b/tests/testsuite/cargo_add/list_features_path/in/dependency/Cargo.toml @@ -3,8 +3,7 @@ name = "your-face" version = "0.1.3" [dependencies] -toml_edit = "0.1.5" -atty = "0.2.13" +my-package = "0.1.1" optional-dependency = { path = "../optional", optional = true } [features] diff --git a/tests/testsuite/cargo_add/list_features_path/in/optional/Cargo.toml b/tests/testsuite/cargo_add/list_features_path/in/optional/Cargo.toml index 0216dba8987..cb61a05144c 100644 --- a/tests/testsuite/cargo_add/list_features_path/in/optional/Cargo.toml +++ b/tests/testsuite/cargo_add/list_features_path/in/optional/Cargo.toml @@ -1,7 +1,6 @@ [package] -name = "optional-dep" +name = "optional-dependency" version = "0.1.3" [dependencies] -toml_edit = "0.1.5" -atty = "0.2.13" +my-package = "0.1.1" diff --git a/tests/testsuite/cargo_add/list_features_path/out/dependency/Cargo.toml b/tests/testsuite/cargo_add/list_features_path/out/dependency/Cargo.toml index 34157f41182..18041a53fd6 100644 --- a/tests/testsuite/cargo_add/list_features_path/out/dependency/Cargo.toml +++ b/tests/testsuite/cargo_add/list_features_path/out/dependency/Cargo.toml @@ -3,8 +3,7 @@ name = "your-face" version = "0.1.3" [dependencies] -toml_edit = "0.1.5" -atty = "0.2.13" +my-package = "0.1.1" optional-dependency = { path = "../optional", optional = true } [features] diff --git a/tests/testsuite/cargo_add/list_features_path_no_default/in/dependency/Cargo.toml b/tests/testsuite/cargo_add/list_features_path_no_default/in/dependency/Cargo.toml index 34157f41182..18041a53fd6 100644 --- a/tests/testsuite/cargo_add/list_features_path_no_default/in/dependency/Cargo.toml +++ b/tests/testsuite/cargo_add/list_features_path_no_default/in/dependency/Cargo.toml @@ -3,8 +3,7 @@ name = "your-face" version = "0.1.3" [dependencies] -toml_edit = "0.1.5" -atty = "0.2.13" +my-package = "0.1.1" optional-dependency = { path = "../optional", optional = true } [features] diff --git a/tests/testsuite/cargo_add/list_features_path_no_default/in/optional/Cargo.toml b/tests/testsuite/cargo_add/list_features_path_no_default/in/optional/Cargo.toml index 0216dba8987..cb61a05144c 100644 --- a/tests/testsuite/cargo_add/list_features_path_no_default/in/optional/Cargo.toml +++ b/tests/testsuite/cargo_add/list_features_path_no_default/in/optional/Cargo.toml @@ -1,7 +1,6 @@ [package] -name = "optional-dep" +name = "optional-dependency" version = "0.1.3" [dependencies] -toml_edit = "0.1.5" -atty = "0.2.13" +my-package = "0.1.1" diff --git a/tests/testsuite/cargo_add/list_features_path_no_default/out/dependency/Cargo.toml b/tests/testsuite/cargo_add/list_features_path_no_default/out/dependency/Cargo.toml index 34157f41182..18041a53fd6 100644 --- a/tests/testsuite/cargo_add/list_features_path_no_default/out/dependency/Cargo.toml +++ b/tests/testsuite/cargo_add/list_features_path_no_default/out/dependency/Cargo.toml @@ -3,8 +3,7 @@ name = "your-face" version = "0.1.3" [dependencies] -toml_edit = "0.1.5" -atty = "0.2.13" +my-package = "0.1.1" optional-dependency = { path = "../optional", optional = true } [features] diff --git a/tests/testsuite/cargo_add/overwrite_optional_with_no_optional/in/Cargo.toml b/tests/testsuite/cargo_add/overwrite_optional_with_no_optional/in/Cargo.toml index 195d5c7e061..5ef95320946 100644 --- a/tests/testsuite/cargo_add/overwrite_optional_with_no_optional/in/Cargo.toml +++ b/tests/testsuite/cargo_add/overwrite_optional_with_no_optional/in/Cargo.toml @@ -5,9 +5,9 @@ name = "cargo-list-test-fixture" version = "0.0.0" [features] -default = ["my-package1"] -other = ["my-package1/nose"] +default = ["your-face"] +other = ["your-face/nose"] [dependencies] -my-package1 = { version = "99999.0.0", optional = true } +your-face = { version = "99999.0.0", optional = true } my-package2 = { version = "0.4.1", optional = true } diff --git a/tests/testsuite/cargo_add/overwrite_optional_with_no_optional/mod.rs b/tests/testsuite/cargo_add/overwrite_optional_with_no_optional/mod.rs index 48f3e0bfa6d..fce33e2a66b 100644 --- a/tests/testsuite/cargo_add/overwrite_optional_with_no_optional/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_optional_with_no_optional/mod.rs @@ -14,7 +14,7 @@ fn overwrite_optional_with_no_optional() { snapbox::cmd::Command::cargo_ui() .arg("add") - .arg_line("my-package1 my-package2@0.4.1 --no-optional") + .arg_line("your-face my-package2@0.4.1 --no-optional") .current_dir(cwd) .assert() .success() diff --git a/tests/testsuite/cargo_add/overwrite_optional_with_no_optional/out/Cargo.toml b/tests/testsuite/cargo_add/overwrite_optional_with_no_optional/out/Cargo.toml index 6301685d17e..bf6c52963b8 100644 --- a/tests/testsuite/cargo_add/overwrite_optional_with_no_optional/out/Cargo.toml +++ b/tests/testsuite/cargo_add/overwrite_optional_with_no_optional/out/Cargo.toml @@ -6,8 +6,8 @@ version = "0.0.0" [features] default = [] -other = ["my-package1/nose"] +other = ["your-face/nose"] [dependencies] -my-package1 = { version = "99999.0.0" } +your-face = { version = "99999.0.0" } my-package2 = { version = "0.4.1" } diff --git a/tests/testsuite/cargo_add/overwrite_optional_with_no_optional/stderr.log b/tests/testsuite/cargo_add/overwrite_optional_with_no_optional/stderr.log index fb8d4903d7b..5fe113e86c7 100644 --- a/tests/testsuite/cargo_add/overwrite_optional_with_no_optional/stderr.log +++ b/tests/testsuite/cargo_add/overwrite_optional_with_no_optional/stderr.log @@ -1,3 +1,8 @@ Updating `dummy-registry` index - Adding my-package1 v99999.0.0 to dependencies. + Adding your-face v99999.0.0 to dependencies. + Features: + - ears + - eyes + - mouth + - nose Adding my-package2 v0.4.1 to dependencies. diff --git a/tests/testsuite/cargo_add/preserve_sorted/in/Cargo.toml b/tests/testsuite/cargo_add/preserve_sorted/in/Cargo.toml index 2716d647883..550e41b07e9 100644 --- a/tests/testsuite/cargo_add/preserve_sorted/in/Cargo.toml +++ b/tests/testsuite/cargo_add/preserve_sorted/in/Cargo.toml @@ -5,5 +5,5 @@ name = "cargo-list-test-fixture" version = "0.0.0" [dependencies] -atty = "0.2.13" -toml_edit = "0.1.5" +my-package = "0.1.1" +versioned-package = "0.1.1" diff --git a/tests/testsuite/cargo_add/preserve_sorted/out/Cargo.toml b/tests/testsuite/cargo_add/preserve_sorted/out/Cargo.toml index 88222bd2a22..cacd510ccdf 100644 --- a/tests/testsuite/cargo_add/preserve_sorted/out/Cargo.toml +++ b/tests/testsuite/cargo_add/preserve_sorted/out/Cargo.toml @@ -5,6 +5,6 @@ name = "cargo-list-test-fixture" version = "0.0.0" [dependencies] -atty = "0.2.13" +my-package = "0.1.1" toml = "99999.0.0" -toml_edit = "0.1.5" +versioned-package = "0.1.1" diff --git a/tests/testsuite/cargo_add/preserve_unsorted/in/Cargo.toml b/tests/testsuite/cargo_add/preserve_unsorted/in/Cargo.toml index 5957df98b62..f803120a3a0 100644 --- a/tests/testsuite/cargo_add/preserve_unsorted/in/Cargo.toml +++ b/tests/testsuite/cargo_add/preserve_unsorted/in/Cargo.toml @@ -5,5 +5,5 @@ name = "cargo-list-test-fixture" version = "0.0.0" [dependencies] -toml_edit = "0.1.5" -atty = "0.2.13" +versioned-package = "0.1.1" +my-package = "0.1.1" diff --git a/tests/testsuite/cargo_add/preserve_unsorted/out/Cargo.toml b/tests/testsuite/cargo_add/preserve_unsorted/out/Cargo.toml index e01b9255ecc..244a06ab9ae 100644 --- a/tests/testsuite/cargo_add/preserve_unsorted/out/Cargo.toml +++ b/tests/testsuite/cargo_add/preserve_unsorted/out/Cargo.toml @@ -5,6 +5,6 @@ name = "cargo-list-test-fixture" version = "0.0.0" [dependencies] -toml_edit = "0.1.5" -atty = "0.2.13" +versioned-package = "0.1.1" +my-package = "0.1.1" toml = "99999.0.0"