@@ -10,6 +10,18 @@ import TranscodingStreams:
1010const testdir = @__DIR__
1111
1212@testset " Gzip Codec" begin
13+ codec = GzipCompression ()
14+ @test codec isa GzipCompression
15+ @test ismatch (r" ^CodecZlib.GzipCompression\( level=-1, windowbits=\d +\) $" , sprint (show, codec))
16+ @test CodecZlib. initialize (codec) === nothing
17+ @test CodecZlib. finalize (codec) === nothing
18+
19+ codec = GzipDecompression ()
20+ @test codec isa GzipDecompression
21+ @test ismatch (r" ^CodecZlib.GzipDecompression\( windowbits=\d +\) $" , sprint (show, codec))
22+ @test CodecZlib. initialize (codec) === nothing
23+ @test CodecZlib. finalize (codec) === nothing
24+
1325 # `gzip.compress(b"foo")` in Python 3.6.2 (zlib 1.2.8).
1426 gzip_data = b "\x 1f\x 8b\x 08\x 00R\x cc\x 10Y\x 02\x ffK\x cb\x cf\x 07\x 00!es\x 8c\x 03\x 00\x 00\x 00"
1527
@@ -93,6 +105,18 @@ const testdir = @__DIR__
93105end
94106
95107@testset " Zlib Codec" begin
108+ codec = ZlibCompression ()
109+ @test codec isa ZlibCompression
110+ @test ismatch (r" ^CodecZlib\. ZlibCompression\( level=-1, windowbits=\d +\) $" , sprint (show, codec))
111+ @test CodecZlib. initialize (codec) === nothing
112+ @test CodecZlib. finalize (codec) === nothing
113+
114+ codec = ZlibDecompression ()
115+ @test codec isa ZlibDecompression
116+ @test ismatch (r" ^CodecZlib\. ZlibDecompression\( windowbits=\d +\) $" , sprint (show, codec))
117+ @test CodecZlib. initialize (codec) === nothing
118+ @test CodecZlib. finalize (codec) === nothing
119+
96120 # `zlib.compress(b"foo")` in Python 3.6.2 (zlib 1.2.8).
97121 zlib_data = b " x\x 9cK\x cb\x cf\x 07\x 00\x 02\x 82\x 01E"
98122
154178end
155179
156180@testset " Deflate Codec" begin
181+ codec = DeflateCompression ()
182+ @test codec isa DeflateCompression
183+ @test ismatch (r" ^CodecZlib\. DeflateCompression\( level=-1, windowbits=-\d +\) $" , sprint (show, codec))
184+ @test CodecZlib. initialize (codec) === nothing
185+ # FIXME : This test fails.
186+ # @test CodecZlib.finalize(codec) === nothing
187+
188+ codec = DeflateDecompression ()
189+ @test codec isa DeflateDecompression
190+ @test ismatch (r" ^CodecZlib\. DeflateDecompression\( windowbits=-\d +\) $" , sprint (show, codec))
191+ @test CodecZlib. initialize (codec) === nothing
192+ @test CodecZlib. finalize (codec) === nothing
193+
157194 test_roundtrip_read (DeflateCompressionStream, DeflateDecompressionStream)
158195 test_roundtrip_write (DeflateCompressionStream, DeflateDecompressionStream)
159196 test_roundtrip_lines (DeflateCompressionStream, DeflateDecompressionStream)
0 commit comments