Skip to content

Commit a941e94

Browse files
committed
add test
1 parent c78aa63 commit a941e94

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

checker/src/test/resources/standardEnvDump.baseline

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ declare string {
256256
function int64_to_string (int) -> string
257257
function uint64_to_string (uint) -> string
258258
function double_to_string (double) -> string
259-
function bool_to_string (double) -> string
259+
function bool_to_string (bool) -> string
260260
function bytes_to_string (bytes) -> string
261261
function timestamp_to_string (google.protobuf.Timestamp) -> string
262262
function duration_to_string (google.protobuf.Duration) -> string

runtime/src/test/resources/stringConversions.baseline

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ Source: string(-1)
1313
bindings: {}
1414
result: -1
1515

16+
Source: string(true)
17+
=====>
18+
bindings: {}
19+
result: true
20+
1621
Source: string(b'abc\303\203')
1722
=====>
1823
bindings: {}

testing/src/main/java/dev/cel/testing/BaseInterpreterTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,6 +1657,9 @@ public void stringConversions() {
16571657
source = "string(-1)"; // int converts to '-1'
16581658
runTest();
16591659

1660+
source = "string(true)"; // bool converts to 'true'
1661+
runTest();
1662+
16601663
// Byte literals in Google SQL only take the leading byte of an escape character.
16611664
// This means that to translate a byte literal to a UTF-8 encoded string, all bytes must be
16621665
// encoded in the literal as they would be laid out in memory for UTF-8, hence the extra octal

0 commit comments

Comments
 (0)