Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
78242: kv/bulk: fix kvBuf test r=dt a=dt

x 'fits' in y if less than _or equal_, not just less; the code had this right but the
test did not.

Release note: none.

Co-authored-by: David Taylor <[email protected]>
  • Loading branch information
craig[bot] and dt committed Mar 22, 2022
2 parents c8e19d3 + c15a868 commit b2a16b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/kv/bulk/kv_buf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func TestKvBuf(t *testing.T) {
b := kvBuf{}
for i := range src {
size := sz(len(src[i].key) + len(src[i].value))
fits := len(b.entries) < cap(b.entries) && len(b.slab)+int(size) < cap(b.slab)
fits := len(b.entries) <= cap(b.entries) && len(b.slab)+int(size) <= cap(b.slab)

require.Equal(t, fits, b.fits(ctx, size, 0, &none))
if !fits {
Expand Down

0 comments on commit b2a16b0

Please sign in to comment.