From ce49460bae13f5fb2ca685b35fd937ebffed51a3 Mon Sep 17 00:00:00 2001 From: ptweezy Date: Sat, 24 Oct 2026 16:26:59 -0400 Subject: [PATCH] Test gzip headers with a header CRC and seek() from the end before a read No test read a valid header with FHCRC, which _GzipReader checks: the headers() helper lost its only test in 2c4de51. test_seek reads before it seeks from the end, so seek() never had to find the size. --- tests/test_igzip.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/test_igzip.py b/tests/test_igzip.py index 4f0e44f3..0cddfaa5 100644 --- a/tests/test_igzip.py +++ b/tests/test_igzip.py @@ -534,6 +534,26 @@ def headers(): yield header + crc.to_bytes(2, "little") +@pytest.mark.parametrize("header", list(headers())) +def test_decompress_header(header): + data = b"hello world" * 100 + compressed = (header + isal_zlib.compress(data, wbits=-15) + + struct.pack("