rust-pretty-assertions
                                
                                 rust-pretty-assertions copied to clipboard
                                
                                    rust-pretty-assertions copied to clipboard
                            
                            
                            
                        Hex/Binary diff and formatting for number collections
Hello, I really like using this crate for my tests as it makes it a lot easier to spot which byte has changed or regressed from a change. It would be nice if the crate supported hex and/or binary formatting for collections of numbers (e.g. &[u8]), so that you could see much more easily on the bit level what changed about a number, as currently see the difference between two base-10 numbers isn't that useful for me when comparing binary serialisation output.
Hey, thanks for your feedback. Custom formatting is a widely requested feature - it's good to have the additional data points of binary/hex output format.
I have some ideas on how this could be supported with an opt-in feature, I will keep you posted if I implement them.
FWIW since it is a macro, you could always add an additional argument to the macro that accepts a Settings type, this would keep it being compatible with std::assert_* but allow people to opt in on a case by case basis, as at least right now I don't think I would want it to be something that's crate wide enabled or disabled.
assert_eq!([0x80, 0x70], [0x70, 0x80], "binary output mismatched", pretty_assertions::Settings::hex());
@tommilligan I'm also interested in this feature. How much more discussion / design do you think is needed? Do you think you might be open to a PR at some point?