-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve failure message for null vs. null comparisons
Prior to this commit, if the expected and actual values for a failed assertion both had "null" string representations and if either the expected or actual value was the null reference, the generated failure message looked something like the following. expected: null<null> but was: java.lang.String@264b3504<null> This commit improves the assertion failure message in such cases by representing the null reference as "<null>" instead of "null<null>", leading to generated failure messages similar to the following. expected: <null> but was: java.lang.String@264b3504<null> This improvement applies to assertEquals(), assertNull, and any other assertion that internally delegates to format(Object, Object, String) or formatValues(Object, Object) in AssertionUtils. See #2523
- Loading branch information
Showing
3 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
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
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
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
68bcfdd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 👍