-
Notifications
You must be signed in to change notification settings - Fork 51
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
Handle non-existing variable in comparison #676
Merged
remcowesterhoud
merged 4 commits into
main
from
582_non_existing_variables_in_comparison
Jul 12, 2023
Merged
Handle non-existing variable in comparison #676
remcowesterhoud
merged 4 commits into
main
from
582_non_existing_variables_in_comparison
Jul 12, 2023
Conversation
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
Adds a few test cases where we do comparisons on non-existing variables.
Before when we encountered a non-existing variable in a comparison it would result in an error: "no variable found for name 'x'". This commit changes this so we can deal with non-existing variables. They now get treated as ValNull and the comparison succeeds without errors.
Expectations of these existing test cases were wrong. They would expect errors or booleans as a result, where we now return a ValNull. Not all behaviours were clear! As a result some test cases have been ignored until this is clarified.
remcowesterhoud
force-pushed
the
582_non_existing_variables_in_comparison
branch
from
July 7, 2023 09:48
86e4c8c
to
c38488f
Compare
remcowesterhoud
commented
Jul 7, 2023
src/test/scala/org/camunda/feel/impl/interpreter/InterpreterExpressionTest.scala
Show resolved
Hide resolved
saig0
approved these changes
Jul 10, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@remcowesterhoud awesome. 🎉
I like that the new tests are in a separate test class. 👍
Before merging, please add one more test case for the between
operator.
...t/scala/org/camunda/feel/impl/interpreter/InterpreterNonExistingVariableExpressionTest.scala
Show resolved
Hide resolved
src/test/scala/org/camunda/feel/impl/interpreter/InterpreterExpressionTest.scala
Show resolved
Hide resolved
src/test/scala/org/camunda/feel/impl/interpreter/InterpreterNumberExpressionTest.scala
Show resolved
Hide resolved
Adds test cases verifying a comparison with a non-existing variable using `between x and y` will result in ValNull
I have added |
This was referenced Jul 12, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Before when we encountered a non-existing variable in a comparison it would result in an error: "no variable found for name 'x'".
This commit changes this so we can deal with non-existing variables. They now get treated as ValNull and the comparison succeeds without errors.
Related issues
Fixes part of #582