-
Notifications
You must be signed in to change notification settings - Fork 196
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
PiranhaJava // Remove meaningless "assert" and "expect" from JUnits #47
Comments
What's the best way to approach this? I got it working by trying some basic checks in Very hacky code:
where Not sure if adding this logic to |
Can you post the input code and expected output code? I think updating the |
Basically, delete the lines which are test related calls, where Piranha has already visited and substituted with a boolean Original code
Piranha modified code
Expected code:
|
This may be a slightly involved fix and it is better to avoid special casing. We will need to implement multi-pass analysis on the code to get this correct.
For the second pass to succeed in the case given above, methods Another option is to determine the code range that is updated by Piranha and re-run the standard Piranha analysis and restrict the refactorings to those regions. Let us discuss more on the gitter channel before finalizing a solution. |
* Adding support for handling junit and easy mock issue #47 * Introduced a feature that allows unnecessary test methods to be configured via the properties file
This has been resolved in #156. |
Piranha simplification will need manual review and fixing of testcases, but I think it's useful to delete lines like:
expect(true).andReturn(true);
assertFalse(true);
which Piranha leaves behind in test classes after simplifying toggle expressions.
The text was updated successfully, but these errors were encountered: