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

Reformat rrule_test for more informative output on failure #27

Merged
merged 1 commit into from
May 2, 2019

Conversation

ararslan
Copy link
Member

@ararslan ararslan commented May 1, 2019

Currently, if the check for all rules comparing approximately equal to their finite differencing counterparts fails, the test failure just tells you that all(...) was false. If we restructure it as a loop
over the results, a failure will display the actual values that were compared, which is much more informative.

While I was in here, I also changed the map directly below to a loop, since that's what the map was doing; the resulting vector of nothings was not being used. It could just have well have been a foreach, but an explicit loop seems clearer.

I ran into this because, as it turns out, I'm real good at getting tests to fail when adding new stuff.

Currently, if the check for all rules comparing approximately equal to
their finite differencing counterparts fails, the test failure just
tells you that `all(...)` was `false`. If we restructure it as a loop
over the results, a failure will display the actual values that were
compared, which is much more informative.

While I was in here, I also changed the `map` directly below to a loop,
since that's what the `map` was doing; the resulting vector of
`nothing`s was not being used. It could just have well have been a
`foreach`, but an explicit loop seems clearer.
@ararslan ararslan requested a review from willtebbutt May 1, 2019 20:37
@ararslan
Copy link
Member Author

ararslan commented May 2, 2019

I'm just going to merge this since it's a pretty small change without any real downside, and it will be useful for debugging the test failures in #29.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant