Skip to content
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

Include expected and actual in error message when arrays are not the same size. #108

Open
60secs opened this issue Sep 13, 2018 · 1 comment

Comments

@60secs
Copy link

60secs commented Sep 13, 2018

Desired: failure message includes expected and actual json

Actual: Error message only says they aren't the same size.

see:

result.fail(prefix + "[]: Expected " + expected.length() + " values but got " + actual.length());

assertThat(result, failsWithMessage(equalTo("[]: Expected 1 values but got 0")));

@carterpage
Copy link
Member

The purpose of the error message is a succinct explanation. This small change could cause the results to blow up if the array contains many massive JSONObjects. Why not suggest that the invoking test prints the array contents on fail if that's what they want?

Open to more discussion but current inclination is to close as WAI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants