mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-13 03:42:35 -06:00
3982a3eac1
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
134 lines
1.7 KiB
YAML
134 lines
1.7 KiB
YAML
cases:
|
|
- data:
|
|
a:
|
|
- 1
|
|
- 2
|
|
- 3
|
|
- 4
|
|
b:
|
|
v1: hello
|
|
v2: goodbye
|
|
c:
|
|
- x:
|
|
- true
|
|
- false
|
|
- foo
|
|
"y":
|
|
- null
|
|
- 3.14159
|
|
z:
|
|
p: true
|
|
q: false
|
|
d:
|
|
e:
|
|
- bar
|
|
- baz
|
|
f:
|
|
- xs:
|
|
- 1
|
|
ys:
|
|
- 2
|
|
- xs:
|
|
- 2
|
|
ys:
|
|
- 3
|
|
g:
|
|
a:
|
|
- 1
|
|
- 0
|
|
- 0
|
|
- 0
|
|
b:
|
|
- 0
|
|
- 2
|
|
- 0
|
|
- 0
|
|
c:
|
|
- 0
|
|
- 0
|
|
- 0
|
|
- 4
|
|
h:
|
|
- - 1
|
|
- 2
|
|
- 3
|
|
- - 2
|
|
- 3
|
|
- 4
|
|
l:
|
|
- a: bob
|
|
b: -1
|
|
c:
|
|
- 1
|
|
- 2
|
|
- 3
|
|
- 4
|
|
- a: alice
|
|
b: 1
|
|
c:
|
|
- 2
|
|
- 3
|
|
- 4
|
|
- 5
|
|
d: null
|
|
m: []
|
|
numbers:
|
|
- "1"
|
|
- "2"
|
|
- "3"
|
|
- "4"
|
|
strings:
|
|
bar: 2
|
|
baz: 3
|
|
foo: 1
|
|
three: 3
|
|
modules:
|
|
- |
|
|
package test1
|
|
|
|
p(__local0__) = y {
|
|
y = __local0__[_]
|
|
}
|
|
|
|
r = y {
|
|
data.test1.p([1, 2, 3], y)
|
|
}
|
|
- |
|
|
package test2
|
|
|
|
p(1, __local1__) = y {
|
|
y = __local1__
|
|
}
|
|
|
|
p(2, __local2__) = y {
|
|
__local7__ = __local2__ + 1
|
|
y = __local7__
|
|
}
|
|
|
|
r = y {
|
|
data.test2.p(3, 0, y)
|
|
}
|
|
- |
|
|
package test3
|
|
|
|
p(1, __local3__) = y {
|
|
y = __local3__
|
|
}
|
|
|
|
p(2, __local4__) = y {
|
|
__local8__ = __local4__ + 1
|
|
y = __local8__
|
|
}
|
|
|
|
p(__local5__, __local6__) = z {
|
|
z = __local5__
|
|
}
|
|
|
|
r = y {
|
|
data.test3.p(1, 0, y)
|
|
}
|
|
note: functionerrors/function output conflict single
|
|
query: data.test1.r = x
|
|
want_error: functions must not produce multiple outputs for same inputs
|
|
want_error_code: eval_conflict_error
|