pkg/ioutil: n is equal or greater than cw.writeBytes

release-3.4
ping40 2018-10-27 16:06:24 +08:00
parent 583763261f
commit 5a94f97a4f
1 changed files with 2 additions and 2 deletions

View File

@ -37,8 +37,8 @@ func TestPageWriterRandom(t *testing.T) {
if cw.writeBytes > n {
t.Fatalf("wrote %d bytes to io.Writer, but only wrote %d bytes", cw.writeBytes, n)
}
if cw.writeBytes-n > pageBytes {
t.Fatalf("got %d bytes pending, expected less than %d bytes", cw.writeBytes-n, pageBytes)
if n-cw.writeBytes > pageBytes {
t.Fatalf("got %d bytes pending, expected less than %d bytes", n-cw.writeBytes, pageBytes)
}
t.Logf("total writes: %d", cw.writes)
t.Logf("total write bytes: %d (of %d)", cw.writeBytes, n)