forked from TrueCloudLab/frostfs-api-go
[#159] sdk: Define object range in object pkg
Define Range type in object package. Replace Range in client package with the new one. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
14fa89b819
commit
d19e5418da
3 changed files with 80 additions and 40 deletions
25
pkg/object/range_test.go
Normal file
25
pkg/object/range_test.go
Normal file
|
@ -0,0 +1,25 @@
|
|||
package object
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestRange_SetOffset(t *testing.T) {
|
||||
r := NewRange()
|
||||
|
||||
off := uint64(13)
|
||||
r.SetOffset(off)
|
||||
|
||||
require.Equal(t, off, r.GetOffset())
|
||||
}
|
||||
|
||||
func TestRange_SetLength(t *testing.T) {
|
||||
r := NewRange()
|
||||
|
||||
ln := uint64(7)
|
||||
r.SetLength(ln)
|
||||
|
||||
require.Equal(t, ln, r.GetLength())
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue