forked from TrueCloudLab/frostfs-api-go
[#356] refs: Test text marshaling of nil SubnetID
Add `(*refs.SubnetID)(nil).MarshalText()` unit test. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
dc292864aa
commit
5d99e697aa
1 changed files with 12 additions and 0 deletions
|
@ -35,6 +35,18 @@ func TestSubnetID_MarshalText(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
|
||||
require.EqualValues(t, val, res)
|
||||
|
||||
t.Run("nil", func(t *testing.T) {
|
||||
var id *refs.SubnetID
|
||||
|
||||
txt, err := id.MarshalText()
|
||||
require.NoError(t, err)
|
||||
|
||||
res, err := strconv.ParseUint(string(txt), 10, 32)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Zero(t, res)
|
||||
})
|
||||
}
|
||||
|
||||
func TestSubnetID_UnmarshalText(t *testing.T) {
|
||||
|
|
Loading…
Reference in a new issue