forked from TrueCloudLab/frostfs-api-go
[#302] pkg/object: Convert nil SplitID
to nil message
Document that `SplitID.ToV2` method return `nil` when called on `nil`. Document that `NewSplitIDFromV2` function return `nil` when called on `nil`. Write corresponding unit tests. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
2fb67d99d3
commit
bbd651767e
2 changed files with 23 additions and 0 deletions
|
@ -46,3 +46,18 @@ func TestSplitID(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func TestSplitID_ToV2(t *testing.T) {
|
||||
t.Run("nil", func(t *testing.T) {
|
||||
var x *object.SplitID
|
||||
|
||||
require.Nil(t, x.ToV2())
|
||||
})
|
||||
}
|
||||
|
||||
func TestNewIDFromV2(t *testing.T) {
|
||||
t.Run("from nil", func(t *testing.T) {
|
||||
var x []byte
|
||||
|
||||
require.Nil(t, object.NewSplitIDFromV2(x))
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue