Skip to content

Commit fb85d7b

Browse files
Apply suggested fix to tests/zip_crypto.rs from Copilot Autofix (#611)
Signed-off-by: Chris Hennick <4961925+Pr0methean@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
1 parent cd40428 commit fb85d7b

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

tests/zip_crypto.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,13 @@ fn test_encrypted_file_operations() {
130130
#[test]
131131
fn test_partial_buffer_read_crypto() {
132132
use std::io::{BufReader, Read};
133-
// Deliberately pick a buffer capacity in a way that when `ZipCryptoReaderValid` read happens,
134-
// it's not going to take the entire buffer. For this specific test file, the capacity needs to
135-
// be between 13..=46 bytes (and not exactly 44 bytes) to exercise the intended code path. We
136-
// choose the minimum value here (13 bytes) to use the smallest capacity that still triggers
137-
// the intended partial-buffer read behavior for this ZIP fixture; smaller values would not
138-
// exercise that code path, and larger values might cause the entire block to be read at once.
133+
// Choose a buffer capacity such that when `ZipCryptoReaderValid` performs a read, it does
134+
// not consume the entire buffer.
135+
// For this specific test file, the capacity must be between 13 and 46 bytes (but not exactly
136+
// 44 bytes) to exercise the intended code path.
137+
// We use the minimum valid value (13 bytes) so that the smallest capacity still triggers the
138+
// intended partial-buffer read behavior for this ZIP fixture; smaller values would not hit
139+
// that path, and larger values might allow the entire block to be read at once.
139140
const PARTIAL_READ_TRIGGER_BUFFER_SIZE: usize = 13;
140141

141142
let zip_file_bytes = &mut Cursor::new(ZIP_CRYPTO_FILE);

0 commit comments

Comments
 (0)