Skip to content

Commit

Permalink
add a test for repeated type mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
oliversun9 committed Nov 18, 2023
1 parent 9c174c0 commit c905a09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions private/bufpkg/bufcheck/buflint/buflint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ func TestRunProtovalidateRules(t *testing.T) {
bufanalysistesting.NewFileAnnotation(t, "repeated.proto", 45, 5, 45, 48, "PROTOVALIDATE"),
bufanalysistesting.NewFileAnnotation(t, "repeated.proto", 49, 28, 49, 71, "PROTOVALIDATE"),
bufanalysistesting.NewFileAnnotation(t, "repeated.proto", 51, 38, 51, 92, "PROTOVALIDATE"),
bufanalysistesting.NewFileAnnotation(t, "repeated.proto", 53, 26, 53, 74, "PROTOVALIDATE"),
bufanalysistesting.NewFileAnnotation(t, "string.proto", 31, 5, 31, 46, "PROTOVALIDATE"),
bufanalysistesting.NewFileAnnotation(t, "string.proto", 36, 5, 36, 44, "PROTOVALIDATE"),
bufanalysistesting.NewFileAnnotation(t, "string.proto", 41, 5, 41, 44, "PROTOVALIDATE"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@ message RepeatedTest {
int32 not_repeated = 15 [(buf.validate.field).repeated.unique = true];
// map value is also not repeated
map<int32, string> map_field = 16 [(buf.validate.field).map.values.repeated.unique = true];
// int64 does not match int32
int32 wrong_type = 17 [(buf.validate.field).repeated.items.int64.lt = 1];
}

0 comments on commit c905a09

Please sign in to comment.