mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
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>
This commit is contained in:
committed by
GitHub
parent
e61b406547
commit
e549882b07
@@ -0,0 +1,44 @@
|
||||
# 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]
|
||||
|
||||
Reference in New Issue
Block a user