Files
regorus/tests/rvm/rego/cases/builtins_out_params.yaml
Anand Krishnamoorthi b7b3d3ec87 feat: Soft-assert mode for builtin out-params under not
- Add a scoped soft_assert_mode to the compiler so `not` statements compile their subexpressions without emitting hard AssertCondition/AssertNotUndefined instructions.
- Teach binding-plan application to return an optional result register; equality plans now yield a boolean in soft mode, allowing not abs(-5 , 3) to succeed instead of aborting.
- Update function-call, loop, and rule plumbing to consume the new binding-plan outcome, including copying the produced register when an out-parameter equality is used.
- Trim the OPA TODO list to the remaining troublesome folders.

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2025-12-02 15:27:43 -06:00

96 lines
1.8 KiB
YAML

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# Builtin Out-Parameter Test Suite
# Verifies the compiler handles builtin return-argument syntax consistently
# across variable bindings, equality checks, scheduler ordering, and literals.
cases:
- note: builtin_out_param_simple_binding
data: {}
modules:
- |
package test
rule1 if {
floor(1.001, x)
x == 1
}
query: data.test.rule1
want_result: true
- note: builtin_out_param_scheduler_reordering
data: {}
modules:
- |
package test
rule2 if {
x == 1
floor(1.001, x)
}
query: data.test.rule2
want_result: true
- note: builtin_out_param_existing_binding_equality
data: {}
modules:
- |
package test
rule3 if {
x := 1
floor(1.001, x)
}
query: data.test.rule3
want_result: true
- note: builtin_out_param_existing_binding_mismatch
data: {}
modules:
- |
package test
rule31 if {
x := 2
floor(1.001, x)
}
query: data.test.rule31
want_result: "#undefined"
- note: builtin_out_param_literal_success
data: {}
modules:
- |
package test
rule4 if {
floor(1.001, 1)
}
query: data.test.rule4
want_result: true
- note: builtin_out_param_literal_failure
data: {}
modules:
- |
package test
rule5 if {
floor(1.001, 2)
}
query: data.test.rule5
want_result: "#undefined"
- note: builtin_out_param_negated_equality
data: {}
modules:
- |
package test
rule5 if {
not abs(-5, 3)
}
query: data.test.rule5
want_result: true