-
Notifications
You must be signed in to change notification settings - Fork 744
Improve failure message from UniqueItemsConstraint #3279
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
Comments
Sounds good. Should we switch the second line of the message to something like,
|
If a collection has multiple sets of non-unique values: int[] actual = { 1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12, 13 }; should this output all non-unique values:
or just the first non-unique found?
|
I think showing all non-unique values would be best, but either is an improvement 😄 |
Thanks, makes sense to me @rprouse 😀 |
I would suggest to output actual collection as is, and output non-unique only items as third line (via
That would be more informative, and consistent with other similar cases. |
That makes sense to me. @mikkelbu what are your thoughts? I'm happy to implement in either direction, but as the issue creator I'd appreciate your input. |
What of extreme cases? For example...
Seems to me we used to truncate all these lists automatically to some reasonable size that fit on a single line but had a special switch that could force the full display if it should be needed on a re-run. Do we still have that feature? Or is it only for equality tests? |
Agree with @CharliePoole, it should be limited (I think that 10 items is default in such cases). |
I just took a look at the code. And the only place where we truncate the third line of text, i.e. after So I think it makes sense to add the third line as proposed by @Dreamescaper, but at most present 10 non-unique values |
Great, thanks everyone for the input! |
Given the test below, then I expect that is is easy to see the item that is not unique.
But this gives
If the list is even longer then it can be that we cannot see the duplicated element
Gives
The text was updated successfully, but these errors were encountered: