Files
regorus/tests/parser/cases/expressions/call.yaml
T
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

49 lines
1.1 KiB
YAML

# Copyright (c) Rego-Rs Authors.
# Licensed under the Apache 2.0 license.
cases:
- note: basic
rego: |
package test
# A call in rule-ref. This creates an object.
deny[sprintf("Hello %v", ["world"])] = 1
# Trailing comma
x = inc(5,)
policy:
- spec:
head:
compr:
refr:
refbrack:
refr:
var: deny
index:
call:
fcn:
var: sprintf
params:
- string: "Hello %v"
- array:
- string: "world"
assign:
op: =
value:
number: 1
bodies: []
- spec:
head:
compr:
refr:
var: x
assign:
op: "="
value:
call:
fcn:
var: inc
params:
- number: 5
bodies: []