rust-pretty-assertions
rust-pretty-assertions copied to clipboard
Allow optional argument names (replacing "left"/"right")
"left" and "right" are semantically neutral labels. In many cases, it would be easier to understand what is actually failing if the labels could be changed to a something with more meaning (eg, "expect" and "actual"). An example proposed use and output ...
assert_eq!( expect: [1, 2, 4], actual: [1, 2, 8]);
thread 'main' panicked at 'assertion failed: `(expect == actual)`
Diff < expect / actual > :
[
1,
2,
< 4,
> 8,
]
' ...