-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
acl,object: Add new
MatchType
enum values after protocol extension
Make codegen from nspcc-dev/neofs-api@541cd3c. Signed-off-by: Leonard Lyubich <[email protected]>
- Loading branch information
1 parent
70b1ffb
commit 2e32ff6
Showing
8 changed files
with
183 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package acl | ||
|
||
import ( | ||
"testing" | ||
|
||
acl "github.com/nspcc-dev/neofs-api-go/v2/acl/grpc" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestMatchTypeToGRPCField(t *testing.T) { | ||
require.Equal(t, MatchTypeUnknown, MatchTypeFromGRPCField(acl.MatchType_NUM_LE+1)) | ||
require.Equal(t, acl.MatchType_MATCH_TYPE_UNSPECIFIED, MatchTypeToGRPCField(matchTypeLast)) | ||
|
||
for _, tc := range []struct { | ||
m MatchType | ||
g acl.MatchType | ||
}{ | ||
{MatchTypeUnknown, acl.MatchType_MATCH_TYPE_UNSPECIFIED}, | ||
{MatchTypeStringEqual, acl.MatchType_STRING_EQUAL}, | ||
{MatchTypeStringNotEqual, acl.MatchType_STRING_NOT_EQUAL}, | ||
{MatchTypeNotPresent, acl.MatchType_NOT_PRESENT}, | ||
{MatchTypeNumGT, acl.MatchType_NUM_GT}, | ||
{MatchTypeNumGE, acl.MatchType_NUM_GE}, | ||
{MatchTypeNumLT, acl.MatchType_NUM_LT}, | ||
{MatchTypeNumLE, acl.MatchType_NUM_LE}, | ||
} { | ||
require.Equal(t, tc.g, MatchTypeToGRPCField(tc.m), tc) | ||
require.Equal(t, tc.m, MatchTypeFromGRPCField(tc.g), tc) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package object | ||
|
||
import ( | ||
"testing" | ||
|
||
object "github.com/nspcc-dev/neofs-api-go/v2/object/grpc" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestMatchTypeToGRPCField(t *testing.T) { | ||
for _, tc := range []struct { | ||
m MatchType | ||
g object.MatchType | ||
}{ | ||
{MatchUnknown, object.MatchType_MATCH_TYPE_UNSPECIFIED}, | ||
{MatchStringEqual, object.MatchType_STRING_EQUAL}, | ||
{MatchStringNotEqual, object.MatchType_STRING_NOT_EQUAL}, | ||
{MatchNotPresent, object.MatchType_NOT_PRESENT}, | ||
{MatchCommonPrefix, object.MatchType_COMMON_PREFIX}, | ||
{MatchNumGT, object.MatchType_NUM_GT}, | ||
{MatchNumGE, object.MatchType_NUM_GE}, | ||
{MatchNumLT, object.MatchType_NUM_LT}, | ||
{MatchNumLE, object.MatchType_NUM_LE}, | ||
} { | ||
require.Equal(t, tc.g, MatchTypeToGRPCField(tc.m), tc) | ||
require.Equal(t, tc.m, MatchTypeFromGRPCField(tc.g), tc) | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters