4 ms·
We could have a macro like: test_eq!(expected=(<expr>), actual=(<expr>)); Where those "assignments" could be specified in either order. Playground exampl
by tomjakubowski 8y ago
We could have a macro like:
test_eq!(expected=(<expr>), actual=(<expr>));
Where those "assignments" could be specified in either order.
Playground example: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=a4142e215dfb46ebfdab447ec22b6b95 https://play.rust-lang.org/?version=stable&mode=debug&editio...
- xixixao 8y agoI really like this, not that I would want to write this every time, but because you could have a macro rule that doesn't specify expected/actual, for those rare cases where both sides are computed ("actual").