AtheMathmo / rulinalg

A linear algebra library written in Rust
https://crates.io/crates/rulinalg
MIT License
288 stars 58 forks source link

Using assert_*_equal macros in all tests #175

Closed AtheMathmo closed 7 years ago

AtheMathmo commented 7 years ago

We have just merged #163 which gives us flexible scalar comparisons. Currently many of our tests have checks like this:

let det = lu.det();
let expected_det = 3.0;
let diff = det - expected_det;
assert!(diff.abs() < 1e-6);

Instead we can use the new macro:

assert_scalar_eq!(lu.det(), 3.0, comp = float);

This is cleaner and more flexible. To resolve this issue we should convert all existing comparison checks to use the assert_*_eq! macros.

Andlon commented 7 years ago

I believe this was resolved by #177, so closing this issue.