-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for IntelliJ diffing #277
Comments
@wafisher I'm not on the Truth team, and I could very well be wrong about this as I'm going just by memory here, but I thought Truth was already supported by IntelliJ in this way. Can you provide a screenshot proving that it doesn't happen for a typical Truth assertion? |
Unfortunately, all I get is:
|
@wafisher Yes, I think you're actually right! I recently encountered in one of my personal projects that IntelliJ didn't give a It's not clear to me if there is anything Truth can do about this without resorting to a hack of some kind... |
Other than the original question, I have some doubt about the error message (as shown in stack). java.lang.AssertionError: Not true that @jbduncan, what was you testing ?, and how could this end up in a situation like this (where all numbers looks same and still assertion error). In your original screenshot you have different values. |
Hi @dinesh707, I think you have the wrong end of the stick; you'll have to ask @wafisher, as he's the OP of the issue, not me. :) |
Oh just bad copying/pasting I think the last one should be |
The issue is that only certain assertions get this diffing treatment - anything that calls Generally an easy workaround would be to add an assertion about the objects'
Though in this case I'm aware this wouldn't work since their Other assertions, like |
As of Truth 0.41, we are throwing |
@theapache64, do you know if you have JUnit 4 on the classpath? Truth currently needs JUnit 4 to produce the "Click to see difference" output. (We'd like to produce it even without JUnit 4 on the classpath, but we haven't done that work yet.) Truth pulls in JUnit 4 as a transitive Maven dependency by default, but some people exclude it. (There's some history in #333, but I should summarize it someday.) If you don't have JUnit 4 on the classpath, are you writing JUnit 5 tests? |
When I use JUnit's Assert library, IntelliJ will provide a link in the console to a window where I can compare expected vs. actual results. Apparently this is from code like this. Are there any plans to support this with truth?
Thanks!
The text was updated successfully, but these errors were encountered: