Hello,
I've converted my JUnit test code with your convert-junit-assertions-to-assertj.sh script.
In most cases I have no problems and got a very good result. But at some tests I got into trouble (no compile any more ...) . As example here are some git diff's between JUnit code and now after the conversion.
Can you explain, what going wrong with that?
Here are two examples for successful conversion:
- assertEquals("'ABcDe ='", StringHandling.addSingleQuotes("ABcDe ="));
+ assertThat(StringHandling.addSingleQuotes("ABcDe =")).isEqualTo("'ABcDe ='");
And here two example blocks which goes wrong:
If you need further informations, please contact me.
Bye
Roman
Thanks for reporting this, we know the script is not 100% bullet proof but if the conversion is 90% right then it is worth it.
We will improve it based on your feedback.
Hi guys! Is this issue still open? I can help with it :D
@juliodias it is, awesome if you can help!
Thanks @joel-costigliola, I'll do my best! If I have any questions I ask you
Sure, don't hesitate to ask!
Hello! I would also like to help with this issue, if I may.
I will look into it and let you know if I have a question, is that okay @joel-costigliola ?
Hey @juliodias !
Have you had any luck with this?
Please let me know if you need a helping hand with something.
Hello! Is this issue still open? I saw @juliodias wants to contribute to this issue. Is ok now? Or can I work on it?
@Eveneko @ulises-lara thanks!
There had been some improvements in the scripts since 3.13.0 it would be good to test whether this issue is still relevant.
If you could look at that and let us know that would be great.
Hello @joel-costigliola ,
I tried today with the same JUNIT commands from my first comment.
I grab the actual JUNIT migrations scripts and by the way also version 3.15.0 of assert-core from your page.
Sorry, but , the result was the same as in 2018, it fails in all belongings.
If there are new news, keep me informed.
Bye
Roman
The issue is still relevant then and needs some work @Eveneko or @ulises-lara ;-)
OK, I work on it now :-P
@joel-costigliola @romanlinhard Good test cases
The error is the incorrect match for , in regular expressions.
,(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$) can match well, but sed don't support (?=pattern). So I can't solve it by using sed.
Are there other shell commands that can solve this problem? Or can we use python or java to solve it?
And I found that there is no test for the convert scripts, do we need to add it? (Actually I have written one for checking)
I'd rather keep shell scripting if possible as it is widely available (python is available be default in all major OS). Are you saying it can't be done with regular shell scripting?
Having tests would be great indeed, we can start with @romanlinhard initial list of assertions.
Are you saying it can't be done with regular shell scripting?
Yes, at least sed is unable to complete this task. But I will try to use other shell commands. And the python version will be developed synchronously. I try my best :-)
@joel-costigliola Done. Please review the code. Thx :-)