forked from open-policy-agent/opa
-
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.
topdown: Fix confusing error message for minus operator
Fixes open-policy-agent#1643 Signed-off-by: Torin Sandall <torinsandall@gmail.com>
- Loading branch information
Showing
2 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
test/cases/testdata/arithmetic/test-arithmetic-minus-type-error.yaml
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,27 @@ | ||
cases: | ||
- data: | ||
modules: | ||
- | | ||
package test | ||
p { | ||
{1} - 1 | ||
} | ||
note: arithmetic/minus/type error | ||
query: data.test.p = x | ||
want_error: operand 2 must be set but got number | ||
want_error_code: eval_type_error | ||
strict_error: true | ||
- data: | ||
modules: | ||
- | | ||
package test | ||
p { | ||
1 - {1} | ||
} | ||
note: arithmetic/minus/type error | ||
query: data.test.p = x | ||
want_error: operand 2 must be number but got set | ||
want_error_code: eval_type_error | ||
strict_error: true |
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