Created
July 3, 2014 20:21
-
-
Save devilelephant/92a90d31e92219feaba4 to your computer and use it in GitHub Desktop.
Format log output that is compatible with Intellij Idea <Click to see difference> diff viewer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The example is in Groovy but this probably works for any kind of logging for an app/test running in IDEA | |
// The important part is the template: "ComparisonFailure\nexpected:<{?}> but was:<{?}>" | |
// This works for multi-line values for each '?', which is why being able to use in-ide diff is so nice | |
def expected = ... | |
def actual = ... | |
// do your custom comparison, then if fails throw: | |
String msg = "ComparisonFailure\nexpected:<{${expected}}> but was:<{${actual}}>" | |
throw new AssertionError(msg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment