forked from TrueCloudLab/frostfs-sdk-go
[#42] netmap: move package from neofs-api-go
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
1bd89bf797
commit
369bd382b3
24 changed files with 3881 additions and 0 deletions
43
netmap/clause_test.go
Normal file
43
netmap/clause_test.go
Normal file
|
@ -0,0 +1,43 @@
|
|||
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
|
||||
}{
|
||||
{
|
||||
c: ClauseUnspecified,
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
func TestClause_String(t *testing.T) {
|
||||
toPtr := func(v Clause) *Clause {
|
||||
return &v
|
||||
}
|
||||
|
||||
testEnumStrings(t, new(Clause), []enumStringItem{
|
||||
{val: toPtr(ClauseDistinct), str: "DISTINCT"},
|
||||
{val: toPtr(ClauseSame), str: "SAME"},
|
||||
{val: toPtr(ClauseUnspecified), str: "CLAUSE_UNSPECIFIED"},
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue