Skip to content

Commit e9df5ba

Browse files
committed
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.
1 parent 09f49e1 commit e9df5ba

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
@@ -813,9 +813,9 @@ fn new_krate_tarball_with_hard_links() {
813813
let mut header = tar::Header::new_gnu();
814814
assert_ok!(header.set_path("foo-1.1.0/bar"));
815815
header.set_size(0);
816-
header.set_cksum();
817816
header.set_entry_type(tar::EntryType::hard_link());
818817
assert_ok!(header.set_link_name("foo-1.1.0/another"));
818+
header.set_cksum();
819819
assert_ok!(ar.append(&header, &[][..]));
820820
assert_ok!(ar.finish());
821821
}
@@ -826,7 +826,7 @@ fn new_krate_tarball_with_hard_links() {
826826
response.assert_status(StatusCode::OK);
827827
assert_eq!(
828828
response.json(),
829-
json!({ "errors": [{ "detail": "uploaded tarball is malformed or too large when decompressed" }] })
829+
json!({ "errors": [{ "detail": "invalid tarball uploaded" }] })
830830
);
831831
}
832832

0 commit comments

Comments
 (0)