Config-gate gzip test

This commit is contained in:
Jacob Hoffman-Andrews
2022-11-26 01:23:33 -08:00
parent 3745b028c6
commit dc7a8c3ebe

View File

@@ -304,10 +304,8 @@ impl<R: Read + Sized + Done + Into<Stream>> Read for PoolReturnRead<R> {
mod tests { mod tests {
use std::io; use std::io;
use crate::response::Compression;
use crate::stream::{remote_addr_for_test, Stream}; use crate::stream::{remote_addr_for_test, Stream};
use crate::ReadWrite; use crate::ReadWrite;
use chunked_transfer::Decoder as ChunkDecoder;
use super::*; use super::*;
@@ -446,7 +444,11 @@ mod tests {
// decoder reads the exact amount from a chunked stream, not past the 0. This // 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. // happens because gzip has built-in knowledge of the length to read.
#[test] #[test]
#[cfg(feature = "gzip")]
fn read_exact_chunked_gzip() { fn read_exact_chunked_gzip() {
use crate::response::Compression;
use chunked_transfer::Decoder as ChunkDecoder;
let gz_body = vec![ let gz_body = vec![
b'E', b'\r', b'\n', // 14 first chunk b'E', b'\r', b'\n', // 14 first chunk
0x1F, 0x8B, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0xCB, 0x48, 0xCD, 0xC9, 0x1F, 0x8B, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0xCB, 0x48, 0xCD, 0xC9,