Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with OPA repl on iterating #2338

Closed
psibi opened this issue Apr 24, 2020 · 2 comments · Fixed by #2405
Closed

Issue with OPA repl on iterating #2338

psibi opened this issue Apr 24, 2020 · 2 comments · Fixed by #2405

Comments

@psibi
Copy link
Contributor

psibi commented Apr 24, 2020

Expected Behavior

> test = [true,true]
Rule 'test' defined in package repl. Type 'show' to see rules.
> test[_]
+ True
+ True

Actual Behavior

> test = [true,true]
Rule 'test' defined in package repl. Type 'show' to see rules.
> test[_]
+
+

Steps to Reproduce the Problem

~ $ opa run
OPA 0.19.0-dev (commit 0aff6264-dirty, built at 2020-03-29T14:04:08Z)

Run 'help' to see a list of commands.

> test = [true,true]
Rule 'test' defined in package repl. Type 'show' to see rules.
> test[_]
+
+

Additional Info

@tsandall added some additional info in Slack:

Yeah looks like a bug in the way output is pretty printed. If you turn off pretty printing, e.g., enter json in the REPL to switch to json mode, you'll see the answer is correct.
@tsandall
Copy link
Member

For expected behaviour here I'd want to see the same thing we get if you substitute true for any other value except false:

> x[_]
+------+
| x[_] |
+------+
| 1    |
| 1    |
+------+

@tsandall
Copy link
Member

If anyone wants to work on this, feel free to ping me and I can provide some pointers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants