-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add test for #620 #6647
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
Add test for #620 #6647
Conversation
The issue in scala#6642 shows that errors may be latent in seemingly simple fixes if not tested, which can backlash us at critical moment.
I am not sure this is a good idea. Printing a full compilation unit will be very fragile. Changes in type checking can break these tests. In #6310, we already disabled the decompilation tests that were very similar because there were too fragile. Also note that we already have similar tests in PrinterTests. These tests are more fine grained and are less likely to break to unrelated changes. I think we should improve on them and expose a nicer API that require less boilerplate to define a test. |
Thanks for raising the concern. I comment inline below:
The difference from #6310 is that we don't blindly decompile Scala files in the test set and check the output. In contrast, the files we put in the printing test are carefully designed. It means:
With
I see two problems with that approach:
|
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.
The code itself LGTM
The remaining question is about stability of the test. As @liufengyun stated here we will handcraft the code to be as stable as possible while printing the desired part of the code. Hence we should not fall into the same amount of differences as with the decompiler tests.
I propose to merge it and see if we get into stability issues. If we do we can remove or modify the test infrastructure yet again.
The issue in #6642 shows that errors may be latent in seemingly
simple fixes if not tested, which can backlash us at a critical moment.