Skip to content

Commit 4d86b26

Browse files
committed
fix test
1 parent 70dc9c0 commit 4d86b26

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

tests/testsuite/publish_lockfile.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,10 @@ fn ignore_lockfile_inner() {
494494
}
495495

496496
#[cargo_test]
497-
fn respect_workspace_lockfile() {
497+
fn use_workspace_root_lockfile() {
498498
// Issue #11148
499+
// Workspace members should use `Cargo.lock` at workspace root
500+
499501
Package::new("serde", "0.2.0").publish();
500502
Package::new("serde", "0.2.1").publish();
501503

@@ -535,9 +537,13 @@ fn respect_workspace_lockfile() {
535537
)
536538
.file("bar/src/main.rs", "fn main() {}")
537539
.build();
540+
541+
// Create `Cargo.lock` in the workspace root, and set it to use
542+
// `serde v0.2.0`
538543
p.cargo("generate-lockfile").run();
539544
p.cargo("update -p serde:0.2.1 --precise 0.2.0").run();
540545

546+
// Expect: package `bar` uses `serde v0.2.0` as required by workspace lock
541547
p.cargo("package --workspace")
542548
.with_stderr(
543549
"\
@@ -547,17 +553,15 @@ See [..]
547553
[UPDATING] `dummy-registry` index
548554
[VERIFYING] bar v0.0.1 ([CWD]/bar)
549555
[DOWNLOADING] crates ...
550-
[DOWNLOADED] serde v0.2.1 ([..])
551-
[COMPILING] serde v0.2.1
556+
[DOWNLOADED] serde v0.2.0 ([..])
557+
[COMPILING] serde v0.2.0
552558
[COMPILING] bar v0.0.1 ([CWD][..])
553559
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
554560
[PACKAGED] 4 files, [..]
555561
[WARNING] manifest has no documentation, [..]
556562
See [..]
557563
[PACKAGING] foo v0.0.1 ([CWD])
558564
[VERIFYING] foo v0.0.1 ([CWD])
559-
[DOWNLOADING] crates ...
560-
[DOWNLOADED] serde v0.2.0 ([..])
561565
[COMPILING] serde v0.2.0
562566
[COMPILING] foo v0.0.1 ([CWD][..])
563567
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]

0 commit comments

Comments
 (0)