forked from microsoft/regorus
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 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 <[email protected]>
- Loading branch information
Showing
9 changed files
with
203 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
cases: | ||
- note: negative-integer-literal-in-arithmetic-expressions | ||
data: {} | ||
modules: | ||
- | | ||
# In the following, the negative integer must be broken into a - and an integer tokens | ||
# when in arighmetic expression contexts | ||
package test | ||
a = 1+1-1 | ||
b = 1 +1 -1 | ||
c = 1 + 1 - 1 | ||
d = -1 -1 | ||
query: data.test | ||
want_result: | ||
a: 1 | ||
b: 1 | ||
c: 1 | ||
d: -2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters