diff --git a/pkg/object/splitid_test.go b/pkg/object/splitid_test.go index 8adcc860..04b40f7b 100644 --- a/pkg/object/splitid_test.go +++ b/pkg/object/splitid_test.go @@ -45,3 +45,4 @@ func TestSplitID(t *testing.T) { }) }) } + diff --git a/pkg/object/tombstone.go b/pkg/object/tombstone.go index 469e6846..add7f5d5 100644 --- a/pkg/object/tombstone.go +++ b/pkg/object/tombstone.go @@ -9,6 +9,8 @@ import ( type Tombstone tombstone.Tombstone // NewTombstoneFromV2 wraps v2 Tombstone message to Tombstone. +// +// Nil tombstone.Tombstone converts to nil. func NewTombstoneFromV2(tV2 *tombstone.Tombstone) *Tombstone { return (*Tombstone)(tV2) } diff --git a/pkg/object/tombstone_test.go b/pkg/object/tombstone_test.go index 21103baf..f9a06505 100644 --- a/pkg/object/tombstone_test.go +++ b/pkg/object/tombstone_test.go @@ -5,6 +5,7 @@ import ( "crypto/sha256" "testing" + "github.com/nspcc-dev/neofs-api-go/v2/tombstone" "github.com/stretchr/testify/require" ) @@ -63,3 +64,11 @@ func TestTombstoneEncoding(t *testing.T) { require.Equal(t, ts, ts2) }) } + +func TestNewTombstoneFromV2(t *testing.T) { + t.Run("from nil", func(t *testing.T) { + var x *tombstone.Tombstone + + require.Nil(t, NewTombstoneFromV2(x)) + }) +}