Skip to content

Commit a5647da

Browse files
committed
test(priv_dep): cargo-test-support support publish public dependency
1 parent 624fc70 commit a5647da

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

crates/cargo-test-support/src/registry.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1429,6 +1429,7 @@ impl Package {
14291429
"kind": dep.kind,
14301430
"registry": registry_url,
14311431
"package": dep.package,
1432+
"public": dep.public
14321433
})
14331434
})
14341435
.collect::<Vec<_>>();

tests/testsuite/pub_priv.rs

+26-4
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,19 @@ fn recursive_package_pub_no_warning() {
532532

533533
p.cargo("check --message-format=short")
534534
.masquerade_as_nightly_cargo(&["public-dependency"])
535-
.with_stderr_contains(
536-
"src/lib.rs:3:13: warning: type `FromPub` from private dependency 'grandparent_bar' in public interface"
535+
.with_stderr(
536+
"\
537+
[UPDATING] `[..]` index
538+
[DOWNLOADING] crates ...
539+
[DOWNLOADED] pub_dep v0.1.0 ([..])
540+
[DOWNLOADED] parent_bar v0.1.0 ([..])
541+
[DOWNLOADED] grandparent_bar v0.1.0 ([..])
542+
[CHECKING] grandparent_bar v0.1.0
543+
[CHECKING] parent_bar v0.1.0
544+
[CHECKING] pub_dep v0.1.0
545+
[CHECKING] foo v0.0.1 ([..])
546+
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
547+
",
537548
)
538549
.run()
539550
}
@@ -590,8 +601,19 @@ fn recursive_package_priv_warning() {
590601

591602
p.cargo("check --message-format=short")
592603
.masquerade_as_nightly_cargo(&["public-dependency"])
593-
.with_stderr_contains(
594-
"src/lib.rs:3:13: warning: type `FromPriv` from private dependency 'grandparent_bar' in public interface"
604+
.with_stderr(
605+
"\
606+
[UPDATING] `[..]` index
607+
[DOWNLOADING] crates ...
608+
[DOWNLOADED] priv_dep v0.1.0 ([..])
609+
[DOWNLOADED] parent_bar v0.1.0 ([..])
610+
[DOWNLOADED] grandparent_bar v0.1.0 ([..])
611+
[CHECKING] grandparent_bar v0.1.0
612+
[CHECKING] parent_bar v0.1.0
613+
[CHECKING] priv_dep v0.1.0
614+
[CHECKING] foo v0.0.1 ([..])
615+
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
616+
",
595617
)
596618
.run()
597619
}

0 commit comments

Comments
 (0)