mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-10 21:50:07 +00:00
8326389: [test] improve assertEquals failure output
Reviewed-by: clanger, jpai
This commit is contained in:
parent
6cad07c23b
commit
9b1f1e5294
@ -201,10 +201,7 @@ public class Asserts {
|
||||
*/
|
||||
public static void assertEquals(Object lhs, Object rhs, String msg) {
|
||||
if ((lhs != rhs) && ((lhs == null) || !(lhs.equals(rhs)))) {
|
||||
msg = Objects.toString(msg, "assertEquals")
|
||||
+ ": expected " + Objects.toString(lhs)
|
||||
+ " to equal " + Objects.toString(rhs);
|
||||
fail(msg);
|
||||
fail((msg == null ? "assertEquals" : msg) + " expected: " + lhs + " but was: " + rhs);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user