* Tolerate empty reads in `quicvarint.Read`
Currently, `quicvarint.Read` misinterprets an empty read (`n==0`)
as a single zero byte. While empty reads are "discouraged" in
the `io.Reader` interface, they do sometimes happen, especially
when using `io.Pipe()`.
This change tolerates empty reads, adds a corresponding unit test,
and also includes some additional test coverage related to empty
capsules
* minor test refactor
---------
Co-authored-by: Marten Seemann <martenseemann@gmail.com>
An io.Reader can read into the buffer and return the io.EOF in the same
call. In fact, that's how the quic.Stream is implemented.
In that case, we shouldn't return an error from quicvarint.Read,
otherwise the caller won't be able to parse a varint sent just before a
stream was closed.