mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-24 09:15:31 -06:00
test: Move test cases out of topdown package
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
This commit is contained in:
@@ -0,0 +1,132 @@
|
||||
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 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)
|
||||
}
|
||||
- |
|
||||
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)
|
||||
}
|
||||
note: functionerrors/function input no match
|
||||
query: data.test2.r = x
|
||||
want_result: []
|
||||
Reference in New Issue
Block a user