Skip to content

Commit 68147de

Browse files
committed
test(publish): Add more dev-dep stripping regression cases
1 parent 3eb2986 commit 68147de

File tree

1 file changed

+47
-1
lines changed

1 file changed

+47
-1
lines changed

tests/testsuite/publish.rs

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1603,6 +1603,12 @@ fn publish_dev_dep_stripping() {
16031603
Package::new("normal-only", "1.0.0")
16041604
.feature("cat", &[])
16051605
.publish();
1606+
Package::new("optional-dep-feature", "1.0.0")
1607+
.feature("cat", &[])
1608+
.publish();
1609+
Package::new("optional-namespaced", "1.0.0")
1610+
.feature("cat", &[])
1611+
.publish();
16061612
Package::new("build-only", "1.0.0")
16071613
.feature("cat", &[])
16081614
.publish();
@@ -1644,11 +1650,15 @@ fn publish_dev_dep_stripping() {
16441650
"target-build-only/cat",
16451651
"target-dev-only/cat",
16461652
"target-normal-and-dev/cat",
1653+
"optional-dep-feature/cat",
1654+
"dep:optional-namespaced",
16471655
]
16481656
16491657
[dependencies]
16501658
normal-only = { version = "1.0", features = ["cat"] }
16511659
normal-and-dev = { version = "1.0", features = ["cat"] }
1660+
optional-dep-feature = { version = "1.0", features = ["cat"], optional = true }
1661+
optional-namespaced = { version = "1.0", features = ["cat"], optional = true }
16521662
16531663
[build-dependencies]
16541664
build-only = { version = "1.0", features = ["cat"] }
@@ -1738,6 +1748,28 @@ You may press ctrl-c to skip waiting; the crate should be available shortly.
17381748
"target": null,
17391749
"version_req": "^1.0"
17401750
},
1751+
{
1752+
"default_features": true,
1753+
"features": [
1754+
"cat"
1755+
],
1756+
"kind": "normal",
1757+
"name": "optional-dep-feature",
1758+
"optional": true,
1759+
"target": null,
1760+
"version_req": "^1.0"
1761+
},
1762+
{
1763+
"default_features": true,
1764+
"features": [
1765+
"cat"
1766+
],
1767+
"kind": "normal",
1768+
"name": "optional-namespaced",
1769+
"optional": true,
1770+
"target": null,
1771+
"version_req": "^1.0"
1772+
},
17411773
{
17421774
"default_features": true,
17431775
"features": [
@@ -1814,7 +1846,9 @@ You may press ctrl-c to skip waiting; the crate should be available shortly.
18141846
"normal-and-dev/cat",
18151847
"target-normal-only/cat",
18161848
"target-build-only/cat",
1817-
"target-normal-and-dev/cat"
1849+
"target-normal-and-dev/cat",
1850+
"optional-dep-feature/cat",
1851+
"dep:optional-namespaced"
18181852
]
18191853
},
18201854
"homepage": "foo",
@@ -1865,6 +1899,16 @@ features = ["cat"]
18651899
version = "1.0"
18661900
features = ["cat"]
18671901
1902+
[dependencies.optional-dep-feature]
1903+
version = "1.0"
1904+
features = ["cat"]
1905+
optional = true
1906+
1907+
[dependencies.optional-namespaced]
1908+
version = "1.0"
1909+
features = ["cat"]
1910+
optional = true
1911+
18681912
[dev-dependencies.normal-and-dev]
18691913
version = "1.0"
18701914
features = ["cat"]
@@ -1881,6 +1925,8 @@ foo_feature = [
18811925
"target-normal-only/cat",
18821926
"target-build-only/cat",
18831927
"target-normal-and-dev/cat",
1928+
"optional-dep-feature/cat",
1929+
"dep:optional-namespaced",
18841930
]
18851931
18861932
[target."cfg(unix)".dependencies.target-normal-and-dev]

0 commit comments

Comments
 (0)