Files
regorus/tests/rvm/rego/cases/comprehensions.yaml
Anand Krishnamoorthi bedf667adc feat: Handle literal comparisons that use = and comprehensions without loops
- emit AssertCondition for equality-only assignment plans (outside soft-assert mode) so rules like `0 = 1` fail under the VM just like the interpreter
- let comprehension bodies consume assertion failures by advancing or exiting their iteration context, both in run-to-completion and suspendable execution

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2025-12-03 13:34:14 -06:00

26 lines
581 B
YAML

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# Arithmetic Operations Test Suite
# Tests basic arithmetic operations: addition, multiplication, division, subtraction
cases:
- note: comprehension_basic
data: {}
modules:
- |
package test
main := [(x * 2) | some x in [1, 2, 3]]
query: data.test.main
want_result: [2, 4, 6]
- note: comprehension_equality_failure_returns_empty
data: {}
modules:
- |
package test
z := [x | x := 1; x == 2]
query: data.test.z
want_result: []