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
3 changes: 3 additions & 0 deletions conformance/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ _TEST_DIRS = [
"aggregate",
"aggregate_explicit_list_output",
"aggregate_explicit_optional_none",
"aggregate_nested_all_rules_fall_through_to_empty",
"aggregate_nested_explicit_list_double_wrapping",
"aggregate_nested_multi_branch_match",
"aggregate_nested_single_conditional_match",
"aggregate_shadowed_variables",
"context_pb",
"first_match_nested_aggregate",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: "aggregate_nested_all_rules_fall_through_to_empty"
variables:
- name: "x"
type_name: "int"
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: aggregate_nested_all_rules_fall_through_to_empty
rule:
aggregate:
- rule:
match:
- condition: "x == 1"
output: "'ONE'"
- condition: "x == 2"
output: "'TWO'"
- rule:
match:
- condition: "x == 3"
output: "'THREE'"
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

description: Conformance test for multiple nested match sub-rules under aggregate falling through to empty list
section:
- name: "basic"
tests:
- name: "first_rule_match_one"
input:
x:
value: 1
output:
value: ["ONE"]
- name: "first_rule_match_two"
input:
x:
value: 2
output:
value: ["TWO"]
- name: "second_rule_match_three"
input:
x:
value: 3
output:
value: ["THREE"]
- name: "all_rules_fall_through_to_empty"
input:
x:
value: 99
output:
value: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: "aggregate_nested_multi_branch_match"
variables:
- name: "cond"
type_name: "bool"
- name: "x"
type_name: "int"
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: aggregate_nested_multi_branch_match
rule:
aggregate:
- condition: "cond"
rule:
match:
- condition: "x > 10"
output: "'HIGH'"
- condition: "x > 0"
output: "'LOW'"
- condition: "true"
output: "'DEFAULT'"
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

description: Conformance test for multi-branch nested match rule with optional fallback under aggregate
section:
- name: "basic"
tests:
- name: "first_branch_match"
input:
cond:
value: true
x:
value: 15
output:
value: ["HIGH", "DEFAULT"]
- name: "second_branch_match"
input:
cond:
value: true
x:
value: 5
output:
value: ["LOW", "DEFAULT"]
- name: "nested_fallback_to_empty"
input:
cond:
value: true
x:
value: -1
output:
value: ["DEFAULT"]
- name: "outer_condition_false"
input:
cond:
value: false
x:
value: 15
output:
value: ["DEFAULT"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: "aggregate_nested_single_conditional_match"
variables:
- name: "x"
type_name: "int"
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: aggregate_nested_single_conditional_match
rule:
aggregate:
- condition: "true"
rule:
match:
- condition: "x > 10"
output: "'GT10'"
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

description: Conformance test for single conditional match nested inside aggregate
section:
- name: "basic"
tests:
- name: "condition_true"
input:
x:
value: 15
output:
value: ["GT10"]
- name: "condition_false"
input:
x:
value: 5
output:
value: []
Loading