mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
test: Add RVM compiler testing to ACI tests (#509)
code fixes:
- compiler: add `is_var_bound_in_current_scope` and use it in destructuring so
only the innermost scope blocks rebinding while still catching duplicates
within that block.
- rvm: treat `not` over undefined operands as a successful negation to match
interpreter semantics.
tests/aci:
migrate YAML cases to `data.policy.rule` queries with `{x: …}`
bindings, expand the harness to run interpreter plus RVM (with optional
skipping), align results to the binding format, add readable timing output,
and support a `--filter` flag for targeting cases.
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
committed by
GitHub
parent
a8a3a9809b
commit
12c083e29e
@@ -299,7 +299,10 @@ impl RegoVM {
|
||||
let operand_value = &self.registers[operand as usize];
|
||||
|
||||
if operand_value == &Value::Undefined {
|
||||
self.registers[dest as usize] = Value::Undefined;
|
||||
// In Rego, `not expr` succeeds when `expr` has no results.
|
||||
// When the operand evaluates to undefined we should treat it as
|
||||
// a successful negation instead of propagating undefined.
|
||||
self.registers[dest as usize] = Value::Bool(true);
|
||||
return Ok(InstructionOutcome::Continue);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user