Skip to content

Commit

Permalink
unit test
Browse files Browse the repository at this point in the history
Signed-off-by: thorfour <[email protected]>
  • Loading branch information
thorfour committed Oct 29, 2024
1 parent 88a1fdc commit fe7aa2d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions objstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -595,3 +595,11 @@ func (b *mockBucket) GetRange(ctx context.Context, name string, off, length int6
}
return nil, errors.New("GetRange has not been mocked")
}

func Test_TryToGetSizeLimitedReader(t *testing.T) {
b := &bytes.Buffer{}
r := io.LimitReader(b, 1024)
size, err := TryToGetSize(r)
testutil.Ok(t, err)
testutil.Equals(t, int64(1024), size)
}

0 comments on commit fe7aa2d

Please sign in to comment.