Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions file_reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func TestFileSeek(t *testing.T) {
n, err := io.CopyN(buf, file, int64(len(testStr)))
assert.NoError(t, err)
assert.EqualValues(t, len(testStr), n)
assert.EqualValues(t, testStr, string(buf.Bytes()))
assert.EqualValues(t, testStr, buf.String())

// seek backwards and read it again
off, err = file.Seek(-1*int64(len(testStr)), 1)
Expand All @@ -247,7 +247,7 @@ func TestFileSeek(t *testing.T) {
n, err = io.CopyN(buf, file, int64(len(testStr)))
assert.NoError(t, err)
assert.EqualValues(t, len(testStr), n)
assert.EqualValues(t, testStr, string(buf.Bytes()))
assert.EqualValues(t, testStr, buf.String())

// Do a small forward seek within the block.
off, err = file.Seek(testStrOff, 0)
Expand All @@ -266,7 +266,7 @@ func TestFileSeek(t *testing.T) {
n, err = io.CopyN(buf, file, int64(len(testStr2)))
assert.NoError(t, err)
assert.EqualValues(t, len(testStr2), n)
assert.EqualValues(t, testStr2, string(buf.Bytes()))
assert.EqualValues(t, testStr2, buf.String())

// Now seek forward to another block and read.
off, err = file.Seek(testStr3NegativeOff, 2)
Expand All @@ -277,7 +277,7 @@ func TestFileSeek(t *testing.T) {
n, err = io.CopyN(buf, file, int64(len(testStr3)))
assert.NoError(t, err)
assert.EqualValues(t, len(testStr3), n)
assert.EqualValues(t, testStr3, string(buf.Bytes()))
assert.EqualValues(t, testStr3, buf.String())
}

func TestFileSeekReadSkip(t *testing.T) {
Expand Down