Skip to content

Commit 4c85566

Browse files
committed
Auto merge of #3065 - Turbo87:fix-hard-link-test, r=pietroalbini
tests/krate/publish: Fix `new_krate_tarball_with_hard_links()` The test was receiving "too large when decompressed" because of a broken header checksum, which was mistakenly converted into this error message, because we assume that every `entries()` error is coming from our `LimitErrorReader`. This commit moves the checksum calculation to the right place, which causes the test to now test the correct condition in our `verify_tarball()` function. r? `@pietroalbini`
2 parents 75563da + f3469ed commit 4c85566

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tests/krate/publish.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -859,9 +859,9 @@ fn new_krate_tarball_with_hard_links() {
859859
let mut header = tar::Header::new_gnu();
860860
assert_ok!(header.set_path("foo-1.1.0/bar"));
861861
header.set_size(0);
862-
header.set_cksum();
863862
header.set_entry_type(tar::EntryType::hard_link());
864863
assert_ok!(header.set_link_name("foo-1.1.0/another"));
864+
header.set_cksum();
865865
assert_ok!(ar.append(&header, &[][..]));
866866
assert_ok!(ar.finish());
867867
}
@@ -872,7 +872,7 @@ fn new_krate_tarball_with_hard_links() {
872872
response.assert_status(StatusCode::OK);
873873
assert_eq!(
874874
response.json(),
875-
json!({ "errors": [{ "detail": "uploaded tarball is malformed or too large when decompressed" }] })
875+
json!({ "errors": [{ "detail": "invalid tarball uploaded" }] })
876876
);
877877
}
878878

0 commit comments

Comments
 (0)