frostfs-api-go/refs/types_test.go
Leonard Lyubich f0af5ce759 [#356] refs: Add functions to work with zero subnet
Add helper functions which provide ease of use with subnet zero IDs.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-11-24 17:13:18 +03:00

20 lines
356 B
Go

package refs_test
import (
"testing"
"github.com/nspcc-dev/neofs-api-go/v2/refs"
"github.com/stretchr/testify/require"
)
func TestZeroSubnet(t *testing.T) {
id := new(refs.SubnetID)
require.True(t, refs.IsZeroSubnet(id))
id.SetValue(1)
require.False(t, refs.IsZeroSubnet(id))
refs.MakeZeroSubnet(id)
require.True(t, refs.IsZeroSubnet(id))
}