2020-11-05 09:24:19 +00:00
|
|
|
package netmap
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/nspcc-dev/neofs-api-go/v2/netmap"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestClauseFromV2(t *testing.T) {
|
|
|
|
for _, item := range []struct {
|
|
|
|
c Clause
|
|
|
|
cV2 netmap.Clause
|
|
|
|
}{
|
|
|
|
{
|
2020-11-05 15:35:58 +00:00
|
|
|
c: ClauseUnspecified,
|
2020-11-05 09:24:19 +00:00
|
|
|
cV2: netmap.UnspecifiedClause,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
c: ClauseSame,
|
|
|
|
cV2: netmap.Same,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
c: ClauseDistinct,
|
|
|
|
cV2: netmap.Distinct,
|
|
|
|
},
|
|
|
|
} {
|
|
|
|
require.Equal(t, item.c, ClauseFromV2(item.cV2))
|
|
|
|
require.Equal(t, item.cV2, item.c.ToV2())
|
|
|
|
}
|
|
|
|
}
|