[#413] util/proto: Marshal repeated []byte fields correctly
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
98db3fa284
commit
9e17cdfc76
2 changed files with 19 additions and 5 deletions
|
@ -313,6 +313,10 @@ func TestRepeatedBytesMarshal(t *testing.T) {
|
|||
testRepeatedBytesMarshal(t, [][]byte{}, false)
|
||||
})
|
||||
|
||||
t.Run("empty element", func(t *testing.T) {
|
||||
testRepeatedBytesMarshal(t, [][]byte{{1}, {}}, false)
|
||||
})
|
||||
|
||||
t.Run("nil", func(t *testing.T) {
|
||||
testRepeatedBytesMarshal(t, nil, false)
|
||||
})
|
||||
|
@ -325,6 +329,10 @@ func TestRepeatedStringMarshal(t *testing.T) {
|
|||
testRepeatedStringMarshal(t, data, true)
|
||||
})
|
||||
|
||||
t.Run("empty element", func(t *testing.T) {
|
||||
testRepeatedStringMarshal(t, []string{""}, false)
|
||||
})
|
||||
|
||||
t.Run("empty", func(t *testing.T) {
|
||||
testRepeatedStringMarshal(t, []string{}, false)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue