Skip to content

Commit 41fc354

Browse files
committed
test(decompression-plz): added helper functions for single compression
1 parent 334be72 commit 41fc354

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

decompression-plz/src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@ pub mod tests {
6868
compress_zstd(&gzip_compressed)
6969
}
7070

71+
pub fn single_compression(encoding: &ContentEncoding) -> Vec<u8> {
72+
match encoding {
73+
ContentEncoding::Brotli => compress_brotli(INPUT),
74+
ContentEncoding::Deflate => compress_deflate(INPUT),
75+
ContentEncoding::Gzip => compress_gzip(INPUT),
76+
ContentEncoding::Zstd => compress_zstd(INPUT),
77+
_ => panic!(),
78+
}
79+
}
80+
7181
pub fn all_encoding_info_multi_header() -> Vec<EncodingInfo> {
7282
vec![
7383
EncodingInfo::new(0, vec![ContentEncoding::Brotli]),

0 commit comments

Comments
 (0)