-
Notifications
You must be signed in to change notification settings - Fork 122
Copy-edit the integration tests for simplicity #281
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
Conversation
0b50af2
to
3314a3b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 From a very quick glance, looks reasonable and good tidy ups.
Might be worth checking why the coverage number reports a drop? Maybe a couple extra tests may be wanted.
3314a3b
to
3b06e37
Compare
3b06e37
to
a0ce9d7
Compare
It seems the drop was mostly due to not formatting the expected errors. The old code would print them but not check the error messages which I adjusted and thereby found incorrect error messages like The other loss is
I think that is definitely the case. My plan here is to do more copy editing to become more familiar with the details of the code base and after that work on improving the tests (and adding benchmarks if appropriate). (With the amount of unsafe code it would really be nice to run Miri in CI, but I guess this is impossible due to that unsafe interacting with C code.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
for v in v { | ||
if v.len() != len2 { | ||
return Err(FromVecError::new(v.len(), len2)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, this is a nice catch, thank you.
for elem in iter { | ||
*elem *= 2.0; | ||
*elem *= 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to note the decimal to clarify that *elem
is a float, but I'm not sure about the community's preference or best practices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type of elem
was changed to i32
by
let arr = pyarray![py, [0, 1], [2, 3], [4, 5]];
I changed all tests (where that does not affect their meaning) to work with integers as this avoids having to do tricks like assert_approx_eq!
to check for equality against expectations. With integers, I can for example just use assert_eq!
to compare the exact sums.
No description provided.