@@ -134,74 +134,3 @@ include("codecquadruple.jl")
134
134
for pkg in [" CodecZlib" , " CodecBzip2" , " CodecXz" , " CodecZstd" , " CodecBase" ]
135
135
Pkg. test (pkg)
136
136
end
137
-
138
- # TODO : This should be moved to CodecZlib.jl.
139
- import CodecZlib
140
- import CodecZlib: GzipCompressor, GzipDecompressor
141
- TranscodingStreams. test_chunked_read (GzipCompressor, GzipDecompressor)
142
- TranscodingStreams. test_chunked_write (GzipCompressor, GzipDecompressor)
143
- TranscodingStreams. test_roundtrip_fileio (GzipCompressor, GzipDecompressor)
144
-
145
- @testset " seek" begin
146
- data = transcode (GzipCompressor, b " abracadabra" )
147
- stream = TranscodingStream (GzipDecompressor (), IOBuffer (data))
148
- seekstart (stream)
149
- @test read (stream, 3 ) == b " abr"
150
- seekstart (stream)
151
- @test read (stream, 3 ) == b " abr"
152
- seekend (stream)
153
- # @test eof(stream)
154
- end
155
-
156
- @testset " panic" begin
157
- stream = TranscodingStream (GzipDecompressor (), IOBuffer (" some invalid data" ))
158
- @test_throws ErrorException read (stream)
159
- @test_throws ArgumentError eof (stream)
160
- end
161
-
162
- @testset " open" begin
163
- open (CodecZlib. GzipDecompressorStream, joinpath (dirname (@__FILE__ ), " abra.gzip" )) do stream
164
- @test read (stream) == b " abracadabra"
165
- end
166
- end
167
-
168
- @testset " stats" begin
169
- size = filesize (joinpath (dirname (@__FILE__ ), " abra.gzip" ))
170
- stream = CodecZlib. GzipDecompressorStream (open (joinpath (dirname (@__FILE__ ), " abra.gzip" )))
171
- stats = TranscodingStreams. stats (stream)
172
- @test stats. in == 0
173
- @test stats. out == 0
174
- @test stats. transcoded_in == 0
175
- @test stats. transcoded_out == 0
176
- read (stream, UInt8)
177
- stats = TranscodingStreams. stats (stream)
178
- @test stats. in == size
179
- @test stats. out == 1
180
- @test stats. transcoded_in == size
181
- @test stats. transcoded_out == 11
182
- close (stream)
183
- @test_throws ArgumentError TranscodingStreams. stats (stream)
184
-
185
- buf = IOBuffer ()
186
- stream = CodecZlib. GzipCompressorStream (buf)
187
- stats = TranscodingStreams. stats (stream)
188
- @test stats. in == 0
189
- @test stats. out == 0
190
- @test stats. transcoded_in == 0
191
- @test stats. transcoded_out == 0
192
- write (stream, b " abracadabra" )
193
- stats = TranscodingStreams. stats (stream)
194
- @test stats. in == 11
195
- @test stats. out == 0
196
- @test stats. transcoded_in == 0
197
- @test stats. transcoded_out == 0
198
- write (stream, TranscodingStreams. TOKEN_END)
199
- flush (stream)
200
- stats = TranscodingStreams. stats (stream)
201
- @test stats. in == 11
202
- @test stats. out == position (buf)
203
- @test stats. transcoded_in == 11
204
- @test stats. transcoded_out == position (buf)
205
- close (stream)
206
- @test_throws ArgumentError TranscodingStreams. stats (stream)
207
- end
0 commit comments