Files
regorus/tests/parser/cases/expressions/bool.yaml
Anand Krishnamoorthi cb0b3a1790 Code from github.com/anakrish/rego-rs
Authored by anakrish and mingweishih

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2023-02-09 10:56:54 -08:00

44 lines
1.0 KiB
YAML

# Copyright (c) Rego-Rs Authors.
# Licensed under the Apache 2.0 license.
cases:
- note: basic
rego: |
package test
# bool ops have lower precedence than arithmetic operators
x = 1 + 2 > 3 - 2
# TODO: lock down
# different types against object
# different types against set
# strings etc
policy:
- spec:
head:
compr:
refr:
var: x
assign:
op: =
value:
boolexpr:
op: ">"
lhs:
arithexpr:
op: "+"
lhs:
number: 1
rhs:
number: 2
rhs:
arithexpr:
op: "-"
lhs:
number: 3
rhs:
number: 2
bodies: []