using diff for test failures

I remember seeing this couple of year ago in Intellij.

We wrote tests that compared text outputs from two methods and if results were unequal Intellij would show difference in the diff tool/dialog.
However, I can't reproduce this behavior and don't have source code for those tests anymore.

Does anybody khow how to do such a thing?



1 comment
Comment actions Permalink

experimented little more with assertEquals(String,String)
and it turn out that Intellij will automagically use diff tool for multiline strings

YAI! And thank you Intellij team (this should be documented somewhere, though)

So, when you want to compare long strings in your tests, it makes sense to break them up into multiple lines - helps visualizing the failures


Please sign in to leave a comment.