Files
regorus/tests/interpreter/cases/engine/tests.yaml
Anand Krishnamoorthi e549882b07 More OPA conformance (#77)
- object.union
- object.union_n
- treat negative integers as two separate tokens (Sub and Number)
  when seen in arithmetic expressions
- Ensure that fully query string is parsed
- Evaluate queries in a separate module instead of the last read module.
  This correctly handles queries of the form `x = data.test.y` where x is
  already a ref in `data.test`
- Handle queries producing multiple outputs in test infrastructure
- Add tests for engine
- Add tests locking down valid queries
- Update opa.passing

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2023-12-27 17:00:40 -08:00

45 lines
869 B
YAML

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
cases:
- note: trailing whitespace in query
data: {}
modules: ["package test"]
query: "1 + 1 -2 "
want_result: 0
- note: trailing chars in query
data: {}
modules: ["package test"]
query: "[1]]"
error: expecting EOF
- note: trailing expressions in query
data: {}
modules: ["package test"]
query: "1 2"
error: expecting EOF
- note: multiple statements in query
data: {}
modules: ["package test"]
query: |
a = [1, 2, 3]
true
y = 1 + 1
want_result:
a: [1, 2, 3]
y: 2
- note: comprehensions in query
data: {}
modules: ["package test"]
query: |
true
[1, 2, 3][_]
want_result:
many!:
- [true, 1]
- [true, 2]
- [true, 3]