mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-10-05 11:19:45 +02:00
bufreader: fix Rewind+Read after EOF; Fix too much data read in fetch
This commit is contained in:
committed by
Sergei Aleksandrovich
parent
a3c633f884
commit
2f40a9b430
@@ -64,6 +64,15 @@ func (s *BufferedReaderTestSuite) TestEOF_WhenDataExhausted() {
|
||||
s.Require().NoError(err)
|
||||
s.Equal(5, n)
|
||||
s.Equal("hello", string(p[:n]))
|
||||
|
||||
br.Rewind() // Reset position to 0
|
||||
|
||||
// We shouldn't get EOF after rewinding and reading again
|
||||
n, err = br.Read(p)
|
||||
|
||||
s.Require().NoError(err)
|
||||
s.Equal(5, n)
|
||||
s.Equal("hello", string(p[:n]))
|
||||
}
|
||||
|
||||
func (s *BufferedReaderTestSuite) TestPeek() {
|
||||
|
Reference in New Issue
Block a user