question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing Click to see difference support in IntelliJ

See original GitHub issue

With other assertion Frameworks the logmessage of a failure gets an link to a diff.

org.opentest4j.AssertionFailedError: 
Expected :foo
Actual   :foobar
<Click to see difference>

This is very useful especially with comparing large Json. I don’t get it with strikt. I’d like to have another logmessage, which enables the IntelliJ-Click-to-see-difference-Feature or an IntelliJ-Strikt-Plugin wich does something similar.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
robfletchercommented, Jan 3, 2022

Hmm, that definitely was working at some point. I’ll investigate.

0reactions
yuriykulikovcommented, Sep 13, 2022

Hello, @robd

I am using this function:

fun <T> Assertion.Builder<T>.contentEquals(expected: T): Assertion.Builder<T> {
  fun <T> contentEquals(actual: T, expected: T) =
      when {
        actual is ByteArray && expected is ByteArray -> actual.contentEquals(expected)
        actual is BooleanArray && expected is BooleanArray -> actual.contentEquals(expected)
        actual is CharArray && expected is CharArray -> actual.contentEquals(expected)
        actual is ShortArray && expected is ShortArray -> actual.contentEquals(expected)
        actual is IntArray && expected is IntArray -> actual.contentEquals(expected)
        actual is LongArray && expected is LongArray -> actual.contentEquals(expected)
        actual is FloatArray && expected is FloatArray -> actual.contentEquals(expected)
        actual is DoubleArray && expected is DoubleArray -> actual.contentEquals(expected)
        actual is Array<*> && expected is Array<*> -> actual.contentEquals(expected)
        else -> false
      }

  return assert("is equal to %s", expected) { actual ->
    if (actual == expected || contentEquals(actual, expected)) {
      pass()
    } else {
      fail("expected: <$expected> but was: <$subject>")
    }
  }
}

Does the trick for me 😺

Read more comments on GitHub >

github_iconTop Results From Across the Web

Missing <Click to see difference> in IntelliJ
Hi,. I'm missing feature <Click to see difference> in Jest test results in IntelliJ. If I run the same test in Webstorm there...
Read more >
Formatting output so that Intellij Idea shows diffs for two texts
IntelliJ IDEA is using the hardcoded regular expression. If the text matches the pattern, it will suggest to click to view the difference....
Read more >
Installation Guide - JPA Buddy
Open Plugin Settings IntelliJ IDEA window: clicks File -> Settings -> Plugins -> Installed. Make sure that JPA Buddy there is in this...
Read more >
5 Things You Might Not Know About IntelliJ - Conductor
Once you've wired up your data source you can execute queries in the IDE like so… IntelliJ Data Support. The autocomplete feature is ......
Read more >
An Introduction to Refactoring with IntelliJ IDEA - Baeldung
Let's now check how to extract methods using IntelliJ: Select the expression or lines of code fitting the method we want to create;...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found