Canonicalize by sorting keys instead of values #4455
Labels
feature/assertion
Issues related to assertions and expectations
type/enhancement
A new idea that should be implemented
Using
assertEqualsCanonicalizing
effectively usessort()
to canonicalize arrays. I fail to see where this might become helpful in a unit test scenario (unidentifiable values whose order doesn't matter)? On the other hand (unordered) key/value collections (i.e. arrays with non-integer keys) are a common thing which would need to be canonicalized withksort()
instead and currently are cumbersome to compare against each other.Maybe I'm missing on the design decision behind that. 🙂
Or in other words: What about supporting the latter case out of the box as well?
The text was updated successfully, but these errors were encountered: