[#413] util/proto: Marshal repeated []byte fields correctly

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-08-26 14:18:07 +03:00 committed by fyrchik
parent 98db3fa284
commit 9e17cdfc76
2 changed files with 19 additions and 5 deletions

View file

@ -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)
})