Diff screen

Hi all,

A small question: is it possible to open the 'Diff screen' (eg. the screen when an Junit test fails with a ComparisonFailure) without running Junit tests?

I have a couple of pages of text which I'd like to compare using the integrated diff tool, but I cannot seem to find it. (Currently, I do an assertEquals(,]]>), but this is far from ideal ofcourse, because I need a Junit test, I need to compile my code, etc...)

Erik

7 comments

Hello Erik,

A small question: is it possible to open the 'Diff screen' (eg. the
screen when an Junit test fails with a ComparisonFailure) without
running Junit tests?

I have a couple of pages of text which I'd like to compare using the
integrated diff tool, but I cannot seem to find it. (Currently, I do
an assertEquals(<String>,<String>), but this is far from ideal
ofcourse, because I need a Junit test, I need to compile my code,
etc...)


Select both of the files in Project View and select "Compare Two Files" from
the context menu.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Hi Dimitry,

Thanks for the quick response! However, I don't have any files: I just have two strings/pieces of text. Creating two files for them might be a little bit easier than creating a Junit test, but a quick comparison between two pieces of text (without creating the files) is not possible?

Erik

0

You can create a temporary file and dump both your chunks of text in. Then, copy one chunk, select the other and use "Compare with clipboard" from the editor context menu to bring up the diff view.

0

Hello Erik,

Ctrl-V
select another sting
Compare editor with clipboard
?

-


Anna Kozlova
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

Hi Dimitry,

Thanks for the quick response! However, I don't have any files: I just
have two strings/pieces of text. Creating two files for them might be
a little bit easier than creating a Junit test, but a quick comparison
between two pieces of text (without creating the files) is not
possible?

Erik



0

Ofcourse, all nice workarounds :)

Still I'd prefer Tools -> Diff or something like that, and just be able to post some text in a (non-modal!) screen..

0

Sounds like an idea for a plugin. I'll have a look at the API and see what can be done.

0

How do you actually have your strings if they're not in files? Do you have them as objects in the debugger?

0

Please sign in to leave a comment.