forked from TrueCloudLab/frostfs-api-go
[#168] refs: Implement binary/JSON encoders/decoders on Version
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
9ec57ee9f8
commit
1519a02d63
6 changed files with 103 additions and 4 deletions
|
@ -111,16 +111,14 @@ func TestSignature_StableMarshal(t *testing.T) {
|
|||
|
||||
func TestVersion_StableMarshal(t *testing.T) {
|
||||
versionFrom := generateVersion(2, 0)
|
||||
transport := new(grpc.Version)
|
||||
|
||||
t.Run("non empty", func(t *testing.T) {
|
||||
wire, err := versionFrom.StableMarshal(nil)
|
||||
require.NoError(t, err)
|
||||
|
||||
err = goproto.Unmarshal(wire, transport)
|
||||
require.NoError(t, err)
|
||||
versionTo := new(refs.Version)
|
||||
require.NoError(t, versionTo.Unmarshal(wire))
|
||||
|
||||
versionTo := refs.VersionFromGRPCMessage(transport)
|
||||
require.Equal(t, versionFrom, versionTo)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue