forked from TrueCloudLab/frostfs-api-go
[#288] pkg/eacl: Convert nil eACL target to nil API v2 message
Make `Target.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
8f27d857fa
commit
5844096017
2 changed files with 14 additions and 0 deletions
|
@ -61,3 +61,11 @@ func TestTargetEncoding(t *testing.T) {
|
|||
require.Equal(t, tar, tar2)
|
||||
})
|
||||
}
|
||||
|
||||
func TestTarget_ToV2(t *testing.T) {
|
||||
t.Run("nil", func(t *testing.T) {
|
||||
var x *Target
|
||||
|
||||
require.Nil(t, x.ToV2())
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue