forked from TrueCloudLab/frostfs-api-go
[#168] refs: Implement binary/JSON encoders/decoders on OwnerID
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
c0f3ac51d4
commit
9ec57ee9f8
6 changed files with 110 additions and 6 deletions
|
@ -44,3 +44,16 @@ func TestContainerIDJSON(t *testing.T) {
|
|||
|
||||
require.Equal(t, cid, cid2)
|
||||
}
|
||||
|
||||
func TestOwnerIDJSON(t *testing.T) {
|
||||
o := new(refs.OwnerID)
|
||||
o.SetValue([]byte{1})
|
||||
|
||||
data, err := o.MarshalJSON()
|
||||
require.NoError(t, err)
|
||||
|
||||
o2 := new(refs.OwnerID)
|
||||
require.NoError(t, o2.UnmarshalJSON(data))
|
||||
|
||||
require.Equal(t, o, o2)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue