-
Notifications
You must be signed in to change notification settings - Fork 179
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
Sorted maps in printed test results #916
Comments
I'm seeing some unexpectedly deterministic (thought not sorted) results when using a released version of CIDER. Which, if true, would mean this issue is not relevant. So I'm going to close this for the moment while I check my setup and make sure I know what is going on. |
Ok, it looks like I've run into some internal implementation of Therefore, this issue is still needed to make test output diffable (for smaller maps, anyway). Description of my findingsFor large enough maps, shuffling the keys and reinserting into a map has no effect on the final sort:
This will always print in this order (on my machine anyway):
Even changing the order of the original map data has no effect on the output. But for a map of just one size smaller:
The output is shuffled every time:
|
Currently printed test results (
:expected
,actual
, andgen-input
) are printed with unsorted maps. Some editors/tools could take advantage of providing a useful diff (beyond what:diffs
provides) if the printed results included sorted maps.The sorting can't be done on the IDE side, because it is a printed string at that point, not clojure data anymore.
The following is an example using VSCode, where the VSCode api is called with:
Current diff (unsorted maps):
Improved diff (with sorted maps):
The text was updated successfully, but these errors were encountered: