-
Notifications
You must be signed in to change notification settings - Fork 4
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
Match in Python trips up Python parser in tests #386
Comments
JSAbrahams
added a commit
that referenced
this issue
Dec 23, 2022
The fact that the test still passed means that something is going wrong here under the hood. An issue has been made: #386
Merged
Perhaps we should fork that crate and see if we can't implement this ourselves |
JSAbrahams
added a commit
that referenced
this issue
Dec 27, 2022
* Update logic for raises in handle We now check in the generate stage whether a raise is covered correctly. Looks like we might not even need it in the unification stage. * Add expr type to covered expressions in handle - Fix generate stage to insert return (and assign) in proper locations within try except. * Check whether parents of exception covered Which is also valid. Remove `Raises` `Expect`, which gets rid of a lot of unnecessary logic in the unification stage. * Cleanup * Restore logic for same value of two types * Move shared logic match, handle to constrain_cases * Dynamically add raises to Environment Useful if exceptions in Mamba are not dealt with locally, but say in the function signature, which is allowed. * Add return in nested_exception_check.py The fact that the test still passed means that something is going wrong here under the hood. An issue has been made: #386
JSAbrahams
added a commit
that referenced
this issue
Dec 28, 2022
* Update logic for raises in handle We now check in the generate stage whether a raise is covered correctly. Looks like we might not even need it in the unification stage. * Add expr type to covered expressions in handle - Fix generate stage to insert return (and assign) in proper locations within try except. * Check whether parents of exception covered Which is also valid. Remove `Raises` `Expect`, which gets rid of a lot of unnecessary logic in the unification stage. * Cleanup * Restore logic for same value of two types * Move shared logic match, handle to constrain_cases * Dynamically add raises to Environment Useful if exceptions in Mamba are not dealt with locally, but say in the function signature, which is allowed. * Add return in nested_exception_check.py The fact that the test still passed means that something is going wrong here under the hood. An issue has been made: #386
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description of Bug
It appears that the python parser trips up as soon as it encounters a
match
in Python.When testing, everything before that is parsed.
We can test this by modifying this in one of the test resources and verify that the associate test fails (assuming we don't modify the associate check resource).
However, if we perform modifications after the match, it fails.
How to Reproduce
Take Mamba file
resource/valid/error/nested_exception.mamba
:msg
->msg1
, and observe that the test fails by leaving the associate_check.py
untouched.MyException1
->MyException2
.Observe how the test still passes despite the output not being equivalent to the associate check resource.
For reference, this is the associate
nested_exception_check,py
resource:Expected behavior
The test should fail as soon as the output deviates from the resource.
Additional context
This is a bug in python parser v 0.1.0.
We could update to version 0.2.0, but this only goes up to Python 3.7 it appears.
Therefore, we may need to search for another crate which parses Python files for us.
Furthermore, there appear breaking changes when going from 0.1.0 to 0.2.0, so even if 0.2.0 does in fact resolve the issue, we do need to perform non-trivial changes.
The text was updated successfully, but these errors were encountered: