Skip to content

Commit

Permalink
Fix off-by-one in TestPagebufferReader2
Browse files Browse the repository at this point in the history
  • Loading branch information
andhe authored Jan 27, 2020
1 parent 3e25d77 commit 1bb7749
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion y/y_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func TestPagebufferReader2(t *testing.T) {
require.Equal(t, n, 10, "length of buffer and length written should be equal")
require.NoError(t, err, "unable to write bytes to buffer")

randOffset := int(rand.Int31n(int32(b.length)))
randOffset := int(rand.Int31n(int32(b.length - 1)))
randLength := int(rand.Int31n(int32(b.length - randOffset)))
reader := b.NewReaderAt(randOffset)
// Read randLength bytes.
Expand Down

0 comments on commit 1bb7749

Please sign in to comment.