mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
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>
36 lines
614 B
YAML
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
|
|
|