From dc7a8c3ebe3153e11a0c78043fae4b9358bb0b55 Mon Sep 17 00:00:00 2001 From: Jacob Hoffman-Andrews Date: Sat, 26 Nov 2022 01:23:33 -0800 Subject: [PATCH] Config-gate gzip test --- src/pool.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pool.rs b/src/pool.rs index fb26c39..812365d 100644 --- a/src/pool.rs +++ b/src/pool.rs @@ -304,10 +304,8 @@ impl> Read for PoolReturnRead { mod tests { use std::io; - use crate::response::Compression; use crate::stream::{remote_addr_for_test, Stream}; use crate::ReadWrite; - use chunked_transfer::Decoder as ChunkDecoder; use super::*; @@ -446,7 +444,11 @@ mod tests { // decoder reads the exact amount from a chunked stream, not past the 0. This // happens because gzip has built-in knowledge of the length to read. #[test] + #[cfg(feature = "gzip")] fn read_exact_chunked_gzip() { + use crate::response::Compression; + use chunked_transfer::Decoder as ChunkDecoder; + let gz_body = vec![ b'E', b'\r', b'\n', // 14 first chunk 0x1F, 0x8B, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0xCB, 0x48, 0xCD, 0xC9,