From 9e730ec7ffc722052eae83949330d6ce9e8480ad Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 30 Jul 2024 13:46:58 -0500 Subject: [PATCH] test(publish): Show bad dev-dep stripping See #14321 --- tests/testsuite/publish.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/testsuite/publish.rs b/tests/testsuite/publish.rs index 9c4eabad597..753d40101f2 100644 --- a/tests/testsuite/publish.rs +++ b/tests/testsuite/publish.rs @@ -1609,6 +1609,9 @@ fn publish_dev_dep_stripping() { Package::new("optional-namespaced", "1.0.0") .feature("cat", &[]) .publish(); + Package::new("optional-renamed-namespaced", "1.0.0") + .feature("cat", &[]) + .publish(); Package::new("build-only", "1.0.0") .feature("cat", &[]) .publish(); @@ -1652,6 +1655,7 @@ fn publish_dev_dep_stripping() { "target-normal-and-dev/cat", "optional-dep-feature/cat", "dep:optional-namespaced", + "dep:optional-renamed-namespaced10", ] [dependencies] @@ -1659,6 +1663,7 @@ fn publish_dev_dep_stripping() { normal-and-dev = { version = "1.0", features = ["cat"] } optional-dep-feature = { version = "1.0", features = ["cat"], optional = true } optional-namespaced = { version = "1.0", features = ["cat"], optional = true } + optional-renamed-namespaced10 = { version = "1.0", features = ["cat"], optional = true, package = "optional-renamed-namespaced" } [build-dependencies] build-only = { version = "1.0", features = ["cat"] } @@ -1770,6 +1775,18 @@ You may press ctrl-c to skip waiting; the crate should be available shortly. "target": null, "version_req": "^1.0" }, + { + "default_features": true, + "explicit_name_in_toml": "optional-renamed-namespaced10", + "features": [ + "cat" + ], + "kind": "normal", + "name": "optional-renamed-namespaced", + "optional": true, + "target": null, + "version_req": "^1.0" + }, { "default_features": true, "features": [ @@ -1909,6 +1926,12 @@ version = "1.0" features = ["cat"] optional = true +[dependencies.optional-renamed-namespaced10] +version = "1.0" +features = ["cat"] +optional = true +package = "optional-renamed-namespaced" + [dev-dependencies.normal-and-dev] version = "1.0" features = ["cat"] @@ -1927,6 +1950,7 @@ foo_feature = [ "target-normal-and-dev/cat", "optional-dep-feature/cat", "dep:optional-namespaced", + "dep:optional-renamed-namespaced10", ] [target."cfg(unix)".dependencies.target-normal-and-dev]