forked from TrueCloudLab/frostfs-api-go
[#132] v2/object: Implement stable unmarshaler on Object
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
c125749c6e
commit
e222c441e5
2 changed files with 28 additions and 0 deletions
|
@ -688,3 +688,15 @@ func generateRangeHashResponseBody(n int) *object.GetRangeHashResponseBody {
|
|||
|
||||
return resp
|
||||
}
|
||||
|
||||
func TestObject_StableUnmarshal(t *testing.T) {
|
||||
obj := generateObject("some data")
|
||||
|
||||
data, err := obj.StableMarshal(nil)
|
||||
require.NoError(t, err)
|
||||
|
||||
obj2 := new(object.Object)
|
||||
require.NoError(t, obj2.StableUnmarshal(data))
|
||||
|
||||
require.Equal(t, obj, obj2)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue