forked from TrueCloudLab/frostfs-api-go
[#168] object: Implement binary/JSON encoders/decoders on Header
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
78374caa41
commit
b8f86f1a60
4 changed files with 45 additions and 5 deletions
|
@ -42,3 +42,15 @@ func TestSplitHeaderJSON(t *testing.T) {
|
|||
|
||||
require.Equal(t, h, h2)
|
||||
}
|
||||
|
||||
func TestHeaderJSON(t *testing.T) {
|
||||
h := generateHeader(10)
|
||||
|
||||
data, err := h.MarshalJSON()
|
||||
require.NoError(t, err)
|
||||
|
||||
h2 := new(object.Header)
|
||||
require.NoError(t, h2.UnmarshalJSON(data))
|
||||
|
||||
require.Equal(t, h, h2)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue