Skip to content

test: add comprehensive zlib compression module coverage - #3377

Merged
oferchen merged 2 commits into
masterfrom
test/zlib-module-coverage
Apr 25, 2026
Merged

oferchen merged 2 commits into
masterfrom
test/zlib-module-coverage

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Add 30 new tests covering previously untested code paths in crates/compress/src/zlib/
  • Test CompressionLevel::None, Fast, and Best variants for both helper and streaming roundtrips
  • Test from_numeric(0) returning None, multiple out-of-range values, error display messages, and error equality
  • Test CompressionLevel trait derives (Clone, Copy, Debug, PartialEq) and From<CompressionLevel> for Compression for all variants
  • Test edge cases: single byte streaming, 1 MB large data, incompressible data, invalid/truncated compressed input
  • Test decoder partial reads with small buffers, zero-length read buffers, and byte count accumulation
  • Test encoder write_all, write_fmt trait methods, bytes_written vs finish consistency
  • Test precise() constructor and Best vs Fast output size comparison
  • Test None level does not shrink data (stored uncompressed)

Test plan

  • All 150 zlib tests pass via cargo nextest run -p compress --all-features -E 'test(zlib)'
  • cargo fmt --all applied

@github-actions github-actions Bot added the test label Apr 25, 2026
@oferchen
oferchen force-pushed the test/zlib-module-coverage branch from 2376b75 to 657a1ea Compare April 25, 2026 15:11
@oferchen
oferchen force-pushed the test/zlib-module-coverage branch from 4c7488d to 83501a7 Compare April 25, 2026 18:07
@oferchen
oferchen merged commit e8e9a18 into master Apr 25, 2026
40 of 41 checks passed
@oferchen
oferchen deleted the test/zlib-module-coverage branch April 25, 2026 18:44
oferchen added a commit that referenced this pull request May 1, 2026
* test: add comprehensive zlib compression module coverage

* fix: clippy write_literal lint in zlib encoder write_fmt test
oferchen added a commit that referenced this pull request May 5, 2026
* test: add comprehensive zlib compression module coverage

* fix: clippy write_literal lint in zlib encoder write_fmt test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant