TranscodingStreams.jl icon indicating copy to clipboard operation
TranscodingStreams.jl copied to clipboard

Avoid double counting in `stats` `out` when writing to nested streams

Open nhz2 opened this issue 1 year ago • 0 comments

Here is an example of the bug this PR fixes:

using Test
using TranscodingStreams
stream = NoopStream(NoopStream(IOBuffer()))
write(stream, b"foobar")
flush(stream)
@test TranscodingStreams.stats(stream).out == 6

Before this PR this would output 12 even though only 6 bytes were written to the underlying stream.

nhz2 avatar Apr 06 '24 23:04 nhz2