mindsbackyard / galvanic-assert

A comprehensive set of matcher-based assertions for easier testing of Rust code
Apache License 2.0
40 stars 2 forks source link

Pretty assertion printing #1

Open brendanzab opened 7 years ago

brendanzab commented 7 years ago

pretty-assertions gives some really nice, colourful diffs when printing out assertion failures using the difference crate:

pretty assertion screenshot

I'm wondering how hard it would be to add these to galvanic-assert? Would make for some nice screenshots of your own!

mindsbackyard commented 7 years ago

Definitely on the list for a future version. Although the difference output would need to be coded for each matcher. Some matchers (especially the collection matchers) have already customized error output (though no colours). In such cases the more specialized output might be more suitable than a generic diff. Ideally I'd like to be able to switch output formatters, so you could choose your format, e.g., when logging to a file you wouldn't like to have terminal colour codes in the output. I'm open for suggestions.