forked from TrueCloudLab/frostfs-api-go
[#302] pkg/object: Document default values set in NewTombstone
Document field values of instance constructed via `NewTombstone`. Assert the values in corresponding unit test. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
753402c336
commit
2fb67d99d3
2 changed files with 30 additions and 0 deletions
|
@ -72,3 +72,21 @@ func TestNewTombstoneFromV2(t *testing.T) {
|
|||
require.Nil(t, NewTombstoneFromV2(x))
|
||||
})
|
||||
}
|
||||
|
||||
func TestNewTombstone(t *testing.T) {
|
||||
t.Run("default values", func(t *testing.T) {
|
||||
ts := NewTombstone()
|
||||
|
||||
// check initial values
|
||||
require.Nil(t, ts.SplitID())
|
||||
require.Nil(t, ts.Members())
|
||||
require.Zero(t, ts.ExpirationEpoch())
|
||||
|
||||
// convert to v2 message
|
||||
tsV2 := ts.ToV2()
|
||||
|
||||
require.Nil(t, tsV2.GetSplitID())
|
||||
require.Nil(t, tsV2.GetMembers())
|
||||
require.Zero(t, tsV2.GetExpirationEpoch())
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue