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
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ private enum CseTestCase {
MACRO_SHADOWED_VARIABLE("[x - 1 > 3 ? x - 1 : 5].exists(x, x - 1 > 3) || x - 1 > 3"),
MACRO_SHADOWED_VARIABLE_2("[\"foo\", \"bar\"].map(x, [x + x, x + x]).map(x, [x + x, x + x])"),
PRESENCE_TEST("has({'a': true}.a) && {'a':true}['a']"),
PRESENCE_TEST_2("has({'a': true}.a) && has({'a': true}.a)"),
PRESENCE_TEST_WITH_TERNARY(
"(has(msg.oneof_type.payload) ? msg.oneof_type.payload.single_int64 : 0) == 10"),
PRESENCE_TEST_WITH_TERNARY_2(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,22 @@ Result: true
[BLOCK_RECURSION_DEPTH_8]: true
[BLOCK_RECURSION_DEPTH_9]: true

Test case: PRESENCE_TEST_2
Source: has({'a': true}.a) && has({'a': true}.a)
=====>
Result: true
[CASCADED_BINDS]: true
[BLOCK_COMMON_SUBEXPR_ONLY]: true
[BLOCK_RECURSION_DEPTH_1]: true
[BLOCK_RECURSION_DEPTH_2]: true
[BLOCK_RECURSION_DEPTH_3]: true
[BLOCK_RECURSION_DEPTH_4]: true
[BLOCK_RECURSION_DEPTH_5]: true
[BLOCK_RECURSION_DEPTH_6]: true
[BLOCK_RECURSION_DEPTH_7]: true
[BLOCK_RECURSION_DEPTH_8]: true
[BLOCK_RECURSION_DEPTH_9]: true

Test case: PRESENCE_TEST_WITH_TERNARY
Source: (has(msg.oneof_type.payload) ? msg.oneof_type.payload.single_int64 : 0) == 10
=====>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2228,6 +2228,43 @@ CALL [1] {
}
}
}
Test case: PRESENCE_TEST_2
Source: has({'a': true}.a) && has({'a': true}.a)
=====>
CALL [1] {
function: cel.@block
args: {
CREATE_LIST [2] {
elements: {
CREATE_MAP [3] {
MAP_ENTRY [4] {
key: {
CONSTANT [5] { value: "a" }
}
value: {
CONSTANT [6] { value: true }
}
}
}
}
}
CALL [7] {
function: _&&_
args: {
SELECT [8] {
IDENT [9] {
name: @index0
}.a~presence_test
}
SELECT [10] {
IDENT [11] {
name: @index0
}.a~presence_test
}
}
}
}
}
Test case: PRESENCE_TEST_WITH_TERNARY
Source: (has(msg.oneof_type.payload) ? msg.oneof_type.payload.single_int64 : 0) == 10
=====>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2846,6 +2846,43 @@ CALL [1] {
}
}
}
Test case: PRESENCE_TEST_2
Source: has({'a': true}.a) && has({'a': true}.a)
=====>
CALL [1] {
function: cel.@block
args: {
CREATE_LIST [2] {
elements: {
CREATE_MAP [3] {
MAP_ENTRY [4] {
key: {
CONSTANT [5] { value: "a" }
}
value: {
CONSTANT [6] { value: true }
}
}
}
}
}
CALL [7] {
function: _&&_
args: {
SELECT [8] {
IDENT [9] {
name: @index0
}.a~presence_test
}
SELECT [10] {
IDENT [11] {
name: @index0
}.a~presence_test
}
}
}
}
}
Test case: PRESENCE_TEST_WITH_TERNARY
Source: (has(msg.oneof_type.payload) ? msg.oneof_type.payload.single_int64 : 0) == 10
=====>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2629,6 +2629,43 @@ CALL [1] {
}
}
}
Test case: PRESENCE_TEST_2
Source: has({'a': true}.a) && has({'a': true}.a)
=====>
CALL [1] {
function: cel.@block
args: {
CREATE_LIST [2] {
elements: {
CREATE_MAP [3] {
MAP_ENTRY [4] {
key: {
CONSTANT [5] { value: "a" }
}
value: {
CONSTANT [6] { value: true }
}
}
}
}
}
CALL [7] {
function: _&&_
args: {
SELECT [8] {
IDENT [9] {
name: @index0
}.a~presence_test
}
SELECT [10] {
IDENT [11] {
name: @index0
}.a~presence_test
}
}
}
}
}
Test case: PRESENCE_TEST_WITH_TERNARY
Source: (has(msg.oneof_type.payload) ? msg.oneof_type.payload.single_int64 : 0) == 10
=====>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2384,6 +2384,43 @@ CALL [1] {
}
}
}
Test case: PRESENCE_TEST_2
Source: has({'a': true}.a) && has({'a': true}.a)
=====>
CALL [1] {
function: cel.@block
args: {
CREATE_LIST [2] {
elements: {
CREATE_MAP [3] {
MAP_ENTRY [4] {
key: {
CONSTANT [5] { value: "a" }
}
value: {
CONSTANT [6] { value: true }
}
}
}
}
}
CALL [7] {
function: _&&_
args: {
SELECT [8] {
IDENT [9] {
name: @index0
}.a~presence_test
}
SELECT [10] {
IDENT [11] {
name: @index0
}.a~presence_test
}
}
}
}
}
Test case: PRESENCE_TEST_WITH_TERNARY
Source: (has(msg.oneof_type.payload) ? msg.oneof_type.payload.single_int64 : 0) == 10
=====>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2321,6 +2321,43 @@ CALL [1] {
}
}
}
Test case: PRESENCE_TEST_2
Source: has({'a': true}.a) && has({'a': true}.a)
=====>
CALL [1] {
function: cel.@block
args: {
CREATE_LIST [2] {
elements: {
CREATE_MAP [3] {
MAP_ENTRY [4] {
key: {
CONSTANT [5] { value: "a" }
}
value: {
CONSTANT [6] { value: true }
}
}
}
}
}
CALL [7] {
function: _&&_
args: {
SELECT [8] {
IDENT [9] {
name: @index0
}.a~presence_test
}
SELECT [10] {
IDENT [11] {
name: @index0
}.a~presence_test
}
}
}
}
}
Test case: PRESENCE_TEST_WITH_TERNARY
Source: (has(msg.oneof_type.payload) ? msg.oneof_type.payload.single_int64 : 0) == 10
=====>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2291,6 +2291,43 @@ CALL [1] {
}
}
}
Test case: PRESENCE_TEST_2
Source: has({'a': true}.a) && has({'a': true}.a)
=====>
CALL [1] {
function: cel.@block
args: {
CREATE_LIST [2] {
elements: {
CREATE_MAP [3] {
MAP_ENTRY [4] {
key: {
CONSTANT [5] { value: "a" }
}
value: {
CONSTANT [6] { value: true }
}
}
}
}
}
CALL [7] {
function: _&&_
args: {
SELECT [8] {
IDENT [9] {
name: @index0
}.a~presence_test
}
SELECT [10] {
IDENT [11] {
name: @index0
}.a~presence_test
}
}
}
}
}
Test case: PRESENCE_TEST_WITH_TERNARY
Source: (has(msg.oneof_type.payload) ? msg.oneof_type.payload.single_int64 : 0) == 10
=====>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2285,6 +2285,43 @@ CALL [1] {
}
}
}
Test case: PRESENCE_TEST_2
Source: has({'a': true}.a) && has({'a': true}.a)
=====>
CALL [1] {
function: cel.@block
args: {
CREATE_LIST [2] {
elements: {
CREATE_MAP [3] {
MAP_ENTRY [4] {
key: {
CONSTANT [5] { value: "a" }
}
value: {
CONSTANT [6] { value: true }
}
}
}
}
}
CALL [7] {
function: _&&_
args: {
SELECT [8] {
IDENT [9] {
name: @index0
}.a~presence_test
}
SELECT [10] {
IDENT [11] {
name: @index0
}.a~presence_test
}
}
}
}
}
Test case: PRESENCE_TEST_WITH_TERNARY
Source: (has(msg.oneof_type.payload) ? msg.oneof_type.payload.single_int64 : 0) == 10
=====>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2282,6 +2282,43 @@ CALL [1] {
}
}
}
Test case: PRESENCE_TEST_2
Source: has({'a': true}.a) && has({'a': true}.a)
=====>
CALL [1] {
function: cel.@block
args: {
CREATE_LIST [2] {
elements: {
CREATE_MAP [3] {
MAP_ENTRY [4] {
key: {
CONSTANT [5] { value: "a" }
}
value: {
CONSTANT [6] { value: true }
}
}
}
}
}
CALL [7] {
function: _&&_
args: {
SELECT [8] {
IDENT [9] {
name: @index0
}.a~presence_test
}
SELECT [10] {
IDENT [11] {
name: @index0
}.a~presence_test
}
}
}
}
}
Test case: PRESENCE_TEST_WITH_TERNARY
Source: (has(msg.oneof_type.payload) ? msg.oneof_type.payload.single_int64 : 0) == 10
=====>
Expand Down
Loading