Skip to content

Commit

Permalink
unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
thorfour committed Oct 28, 2024
1 parent de41e1e commit b444a20
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 b444a20

Please sign in to comment.