RFR: 8266250: WebSocketTest and WebSocketProxyTest call assertEquals(List<byte[]>, List<byte[]>)
Pavel Rappo
prappo at openjdk.java.net
Thu Apr 29 10:28:52 UTC 2021
On Thu, 29 Apr 2021 09:03:31 GMT, Daniel Fuchs <daniel.fuchs at oracle.com> wrote:
> Exactly - that API specification doesn't say whether elements
> that are arrays will be compared using shallow equals or deep
> equals.
Fair enough.
Since you are here, consider further improving diagnosability. The failed comparison should provide more info.
Currently, assertEquals short-circuits by reporting only one property of the lists that differs. If the lists are of different size, it's the size that is reported. If the lists are of the same size, it's the leftmost non-equal element that is reported, if any. In either case, there might be a lot of info missing. Given that the comparables are relatively small, it makes sense to print them out in full.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3776
More information about the net-dev
mailing list