rust-lang / flate2-rs

DEFLATE, gzip, and zlib bindings for Rust
https://docs.rs/flate2
Apache License 2.0
862 stars 159 forks source link

Add tests to show BufRead can be used after decoding #402

Closed jongiddy closed 2 months ago

jongiddy commented 2 months ago

Copy the trailing data tests from gzip::bufread and gzip::write to demonstrate that they also work for zlib and deflate.

This demonstrates that #401 works with bufread decoders.

jongiddy commented 2 months ago

I put the tests here for symmetry with the equivalent gzip tests, which are also currently unit tests. While unit tests can access private items, I've never heard that unit tests must access private items. And, due to the additional build costs of integration tests, I tend to prefer unit tests where possible.

Nevertheless, I can move the tests to the integration level. Should I move the equivalent gzip tests too?

Byron commented 2 months ago

I put the tests here for symmetry with the equivalent gzip tests, which are also currently unit tests.

Apologies, I wasn't aware and didn't want to change the way things are done here. It seems integration tests have a specific purpose (here, making use of fixtures) and unit-tests are used for everything else. Let's keep it that way.