-
-
Notifications
You must be signed in to change notification settings - Fork 355
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
test: Test for duplicate imports #3267 and fqn bug #3369
Conversation
Hi, |
Thanks for the reply @MartinWitt. I need this bug to be resolved. If I mark it as |
A merged testcase makes the workflow easier, because you don't have to checkout the pr to fix it. We created this annotation to merge failing testcases to master. The issue shouldn't be ignored, but a fix could take some time depending on the problem and the time from people. |
This test case is complex, it uses the codebase of my master thesis that @monperrus is familiar with. I don't think this test should be merged for two reasons. First is that the code is part of another project, second is that it has more than 30 files. I agree that approach but this is an edge case that I simply can't unitize. Thanks again @MartinWitt. All I need to publish my code is to have this issue resolved. |
Okay, then it makes sense to not merge it. May I ask you:
I hope i can find some time to look into it at the end of the week, if i got the other issue solved. |
@moraispgsi, thanks for the failing test case.
@MartinWitt, I'm not working on it, it's great if you can have a look!
Thanks you both!
|
It would be great if it was fixed by the end of the month, the thesis is not written yet but the project implementation is near its end. After this bug fix all my unit tests will pass. There may be other smaller problems with Spoon(e.g. sometimes the indentation is wrong after a modification) but not as severe as this one and therefore can be posponed. |
Hey, any news on this issue @MartinWitt @monperrus? |
Currently i need to do some academic stuff and had no time to look into it sry. |
I confirm I can reproduce the bug locally. |
Good news, I have a fix! See last commit. Notes for having super useful failing test cases:
Thanks. |
Hey @monperrus, that is great to hear. There were two problem, the duplicated imports, and the fqn problem. Have you addressed the later as well? Also, I would make a simpler test but I just could not pinpoint the exact problem so I could not replicate it in a simpler test, that is why I had to bring that amount of code into the test, sorry for the trouble. |
Sure. I can't test it right now, will do it as soon as I can. |
Hey @monperrus. I just tested it, the duplicated imports problem is completely fixed, good job. That just leaves the FQN problem, I suppose you want to create a new PR with this fix first and close the #3267 issue before proceeding with the next problem. Thanks again for the effort. |
#3388 extracts the fix from here. for the FQN problem, the problem may be on your side, make sure to call |
I will give it a try and come back to you with the results. Thanks. |
Hey @monperrus so I finally created the test for the duplicated imports #3267 issue. I added the leafactorci code as usual and added a small test with an input file(A.java) and an expected file(B.java). The test is under \src\test\java\spoon\processing\ProcessingTest.java - testRedundantImports(). To see the problem just run the test and see the difference between the files.