Automatically use StrComparison for comparing strings #92
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't use this crate, but I was reviewing someone else's code where they started replacing pretty_assertions::assert_eq -> assert_str_eq and it seemed like a waste of time, compared to producing the most helpful message possible whenever any of this crate's macros is used.
That's up to whether you feel enough of your users would want that to justify building it into this crate's API. From the use case that I am familiar with, I am skeptical that it would be useful.
This sounds like an extreme stance. I don't understand why it would be valuable to your users that the output remain bitwise identical. Rustc definitely doesn't guarantee that for its diagnostics, and the standard library does not guarantee that for its Debug impls, so it's already not the case for uses of pretty-assertions in general.
I'm the one whose code he was reviewing ;), and I agree that the
I, too, have a hard time imagining a case in which I would rather see a bunch of
I concur. From what I understand, the primary (only?) consumer of this output is the human who is running the tests, so this is more like a UI tweak than a breaking change. A breaking change would be if a given usage of
Thanks both for your comments - I agree that I can't think of a good case for preserving the existing behaviour over a more readable one. I find @jkeljo's point about
I will also update the readme with some notes about the guarantees this crate provides about the output changing moving forwards between versions.