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