mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
Old-style function call Utility for running opa yaml tests Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
54 lines
1.1 KiB
YAML
54 lines
1.1 KiB
YAML
# Copyright (c) Microsoft Corporation.
|
|
# Licensed under the MIT License.
|
|
|
|
cases:
|
|
- note: all
|
|
data: {}
|
|
modules:
|
|
- |
|
|
package test
|
|
|
|
x = [
|
|
min([-1, 3, 2]),
|
|
min({1, 2, -1}),
|
|
]
|
|
|
|
r {false}
|
|
u1 = min(r)
|
|
u2 = min([])
|
|
u3 = min(set())
|
|
query: data.test
|
|
want_result:
|
|
x: [ -1, -1 ]
|
|
|
|
- note: invalid-null
|
|
data: {}
|
|
modules: ["package test\n x= min(null)"]
|
|
query: data.test
|
|
error: "`min` requires array/set argument."
|
|
|
|
- note: invalid-bool
|
|
data: {}
|
|
modules: ["package test\n x= min(true)"]
|
|
query: data.test
|
|
error: "`min` requires array/set argument."
|
|
|
|
- note: invalid-number
|
|
data: {}
|
|
modules: ["package test\n x= min(5)"]
|
|
query: data.test
|
|
error: "`min` requires array/set argument."
|
|
|
|
- note: invalid-string
|
|
data: {}
|
|
modules: ["package test\n x= min(`abc`)"]
|
|
query: data.test
|
|
error: "`min` requires array/set argument."
|
|
|
|
- note: invalid-object
|
|
data: {}
|
|
modules: ["package test\n x= min({})"]
|
|
query: data.test
|
|
error: "`min` requires array/set argument."
|
|
|