-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Confusing error message when the length of two multidimensional arrays are not equal #803
Comments
This is expected behaviour for a JUnit test. The first is the expected and the second argument is the comparison. Therefore in this case the |
Can anyone on this thread suggest a better error message? |
If the two arrays at depth N have different lengths, then that's just another instance of two elements at depth N - 1 being unequal. We already have code to construct a nice error message for this situation, in the form of the Thus, I claim the error message for the given example should simply be this:
If you agree, I can open a PR with this small fix:
|
@Stephan202 sounds reasonable. Please make the pull request against the junit5 branch |
Current behavior:
assertArrayEquals((new Object[1][3]), (new Object[1][4]));
// throws ArrayComparisonFailure with message:
// "array lengths differed, expected.length=3 actual.length=4"
If I got this message I would assume that the FIRST dimension was different, but in this example it's the second dimension that's different. Is anyone bothered by this?
The text was updated successfully, but these errors were encountered: