Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using assert_*_equal macros in all tests #175

Closed
AtheMathmo opened this issue Apr 28, 2017 · 1 comment
Closed

Using assert_*_equal macros in all tests #175

AtheMathmo opened this issue Apr 28, 2017 · 1 comment
Labels

Comments

@AtheMathmo
Copy link
Owner

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.

MarkDDR added a commit to MarkDDR/rulinalg that referenced this issue May 5, 2017
* Changed all the easy assert!(diff < eps) to assert_scalar_eq! as I
  could find

There are still a few instances of a regular diff < eps that can be
found in the src/matrix/decomposition/eigen.rs, but they are inside
iterators that make it harder to easily change.

* Spruced up some of the tests and removed compiler warnings about
  unused elements
AtheMathmo pushed a commit that referenced this issue May 7, 2017
* Fixed (#175) and cleaned up a few tests

* Changed all the easy assert!(diff < eps) to assert_scalar_eq! as I
  could find

There are still a few instances of a regular diff < eps that can be
found in the src/matrix/decomposition/eigen.rs, but they are inside
iterators that make it harder to easily change.

* Spruced up some of the tests and removed compiler warnings about
  unused elements

* Simplified qr test in tests/mat/mod.rs

* Changed an assert! to an assert_vector_eq!
@Andlon
Copy link
Collaborator

Andlon commented May 8, 2017

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

@Andlon Andlon closed this as completed May 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants