add string(bool) overload by maorwayn · Pull Request #728 · cel-expr/cel-java · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions checker/src/test/resources/standardEnvDump.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ declare string {
function int64_to_string (int) -> string
function uint64_to_string (uint) -> string
function double_to_string (double) -> string
function bool_to_string (bool) -> string
function bytes_to_string (bytes) -> string
function timestamp_to_string (google.protobuf.Timestamp) -> string
function duration_to_string (google.protobuf.Duration) -> string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ public enum StandardFunction {
Conversions.STRING_TO_STRING,
Conversions.INT64_TO_STRING,
Conversions.DOUBLE_TO_STRING,
Conversions.BOOL_TO_STRING,
Conversions.BYTES_TO_STRING,
Conversions.TIMESTAMP_TO_STRING,
Conversions.DURATION_TO_STRING,
Expand Down Expand Up @@ -478,6 +479,7 @@ public enum Conversions implements StandardOverload {
STRING_TO_STRING(StringOverload.STRING_TO_STRING::newFunctionBinding),
INT64_TO_STRING(StringOverload.INT64_TO_STRING::newFunctionBinding),
DOUBLE_TO_STRING(StringOverload.DOUBLE_TO_STRING::newFunctionBinding),
BOOL_TO_STRING(StringOverload.BOOL_TO_STRING::newFunctionBinding),
BYTES_TO_STRING(StringOverload.BYTES_TO_STRING::newFunctionBinding),
TIMESTAMP_TO_STRING(StringOverload.TIMESTAMP_TO_STRING::newFunctionBinding),
DURATION_TO_STRING(StringOverload.DURATION_TO_STRING::newFunctionBinding),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ public enum StringOverload implements CelStandardOverload {
(celOptions, runtimeEquality) ->
CelFunctionBinding.from("int64_to_string", Long.class, Object::toString)),
DOUBLE_TO_STRING(
(celOptions, runtimeEquality) ->
CelFunctionBinding.from("double_to_string", Double.class, Object::toString)),
(celOptions, runtimeEquality) ->
CelFunctionBinding.from("double_to_string", Double.class, Object::toString)),
BOOL_TO_STRING(
(celOptions, runtimeEquality) ->
CelFunctionBinding.from("bool_to_string", Boolean.class, Object::toString)),
BYTES_TO_STRING(
(celOptions, runtimeEquality) ->
CelFunctionBinding.from(
Expand Down
5 changes: 5 additions & 0 deletions runtime/src/test/resources/stringConversions.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ Source: string(-1)
bindings: {}
result: -1

Source: string(true)
=====>
bindings: {}
result: true

Source: string(b'abc\303\203')
=====>
bindings: {}
Expand Down