You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came across a use case recently where Approvals worked in a way that's different to what I expected. If you're using a sorted map implementation, such as a TreeMap, that sorts keys using something other than natural ordering the output of the approved file is not what is expected. It seems that StringUtils.toString(Map<?, ?> map) sorts maps by their keys by natural ordering. While this behaviour is consistent and the test will pass it's certainly not what you would expect when looking at the file (ask me how long I spent trying to work out why my TreeMap wasn't ordering things as expected before I worked out what was going on... ;) ). Would you consider adding support for sorted maps, maintaining their ordering?
The text was updated successfully, but these errors were encountered:
I came across a use case recently where Approvals worked in a way that's different to what I expected. If you're using a sorted map implementation, such as a TreeMap, that sorts keys using something other than natural ordering the output of the approved file is not what is expected. It seems that
StringUtils.toString(Map<?, ?> map)
sorts maps by their keys by natural ordering. While this behaviour is consistent and the test will pass it's certainly not what you would expect when looking at the file (ask me how long I spent trying to work out why my TreeMap wasn't ordering things as expected before I worked out what was going on... ;) ). Would you consider adding support for sorted maps, maintaining their ordering?The text was updated successfully, but these errors were encountered: