mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
fix: Implement RVM set ops correctly
- treat set subtraction in RVM the same as the interpreter by supporting Value::Set operands in sub_values - emit internal-only builtin names for set union/intersection and register handlers so compiled bytecode resolves without exposing new Rego builtins - add regression coverage for literal set difference/intersection (x/y from failure.rego) in tests/rvm/rego/cases/sets.yaml Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
@@ -67,3 +67,23 @@ cases:
|
||||
- set!: [1, 2]
|
||||
- set!: [3, 4]
|
||||
- set!: ["a", "b"]
|
||||
|
||||
- note: set_difference_literals
|
||||
data: {}
|
||||
modules:
|
||||
- |
|
||||
package test
|
||||
x := {2, 3} - {4, 2}
|
||||
query: data.test.x
|
||||
want_result:
|
||||
set!: [3]
|
||||
|
||||
- note: set_intersection_literals
|
||||
data: {}
|
||||
modules:
|
||||
- |
|
||||
package test
|
||||
y := {2, 3} & {4, 2}
|
||||
query: data.test.y
|
||||
want_result:
|
||||
set!: [2]
|
||||
|
||||
Reference in New Issue
Block a user