Skip to content

Commit 761233d

Browse files
authored
Fix uint test (#353)
The tests for unsigned integers should wrap with a CEL `uint` operator.
1 parent bcf8a4f commit 761233d

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

proto/protovalidate-testing/buf/validate/conformance/cases/custom_constraints/custom_constraints.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,14 @@ message FieldExpressionMapUint32 {
180180
map<uint32, uint32> val = 1 [(buf.validate.field).cel = {
181181
id: "field_expression.map.uint32"
182182
message: "all map values must equal 1"
183-
expression: "this.all(k, this[k] == 1)"
183+
expression: "this.all(k, this[k] == uint(1))"
184184
}];
185185
}
186186
message FieldExpressionMapUint64 {
187187
map<uint64, uint64> val = 1 [(buf.validate.field).cel = {
188188
id: "field_expression.map.uint64"
189189
message: "all map values must equal 1"
190-
expression: "this.all(k, this[k] == 1)"
190+
expression: "this.all(k, this[k] == uint(1))"
191191
}];
192192
}
193193
message FieldExpressionMapBool {

tools/internal/gen/buf/validate/conformance/cases/custom_constraints/custom_constraints.pb.go

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)