forked from TrueCloudLab/frostfs-api-go
[#288] pkg/eacl: Convert nil eACL record to nil API v2 message
Make `Record.ToV2` method to return `nil` when called on `nil`. Write corresponding unit test. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
b81f39368e
commit
18a3c4d54f
2 changed files with 14 additions and 0 deletions
|
@ -119,3 +119,11 @@ func TestRecordEncoding(t *testing.T) {
|
|||
require.Equal(t, r, r2)
|
||||
})
|
||||
}
|
||||
|
||||
func TestRecord_ToV2(t *testing.T) {
|
||||
t.Run("nil", func(t *testing.T) {
|
||||
var x *Record
|
||||
|
||||
require.Nil(t, x.ToV2())
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue