Files
regorus/tests/interpreter/cases/rule/else.yaml
Anand Krishnamoorthi edd0ccca5b fix: Issues #302, #303 (#304)
Handle undefined values correctly in ordered-else. Previously an undefined value
in one of the blocks could cause the entire rule to evaluate to undefined.

Handle undefined values correctly in generic rule refs to prevent them from
propagating to output.

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2024-08-29 09:47:45 -07:00

36 lines
614 B
YAML

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
cases:
# - note: else without body
# data: {}
# modules:
# - |
# package test
# x = 4 {
# false
# } else = 5
# y = 6
# query: data.test
# want_result:
# x: 5
# y: 6
- note: undefined values being assigned
data: {}
modules:
- |
package test
import rego.v1
x := data.y if {
true
} else := 2 if {
true
}
query: data.test
want_result:
x: 2