assert_matrix_eq! improvements (tracking issue)
Andlon opened this issue · comments
Andreas Borgen Longva commented
In this issue, I intend to maintain a list of suggestions for improvements to the assert_matrix_eq!
and assert_vector_eq!
macros. As more contributors get a chance to use it, I would appreciate input on missing features that would make working with it easier. Actual bugs in these macros should still be reported in their own issue.
Potential usability improvements:
- We may want to consider implementing an
assert_scalar_eq!
for scalar comparisons, leveraging the same comparators. Currently we have no facility for this inrulinalg
, and it's a situation that comes up a lot in tests (such as testing that the determinant is almost exactly equal to an expected value). - Print both matrices when the dimension is reasonably small. Currently it's still a little difficult to get a feel for exactly what is wrong in some cases involving small matrices.
Other improvements:
- Consider letting users provide their own comparators (low-priority unless we get requests for this).
- Avoid
Copy
trait bounds and avoid storing copied elements instead of references.