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

Add tests to BrentRoot #525

Closed
wants to merge 0 commits into from
Closed

Add tests to BrentRoot #525

wants to merge 0 commits into from

Conversation

GermanHeim
Copy link
Contributor

Hi, this is my PR for #403.

I added an error message for when a negative tolerance is passed as an argument.
I created a couple of tests:

  • Negative tolerance
  • Invalid range when $f(a)$ and $f(b)$ have the same sign
  • Valid range
  • Check that the algorithm converges for a quadratic problem
  • Symmetry (check that if passing $a$ as $b$ gives the same result)

I implemented a quadratic problem ($x^2 - 1$) to do the tests, but I am unsure if this is the correct way to do it in the library.
Let me know if it needs to be changed.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.92%. Comparing base (be2444e) to head (6006918).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #525      +/-   ##
==========================================
+ Coverage   91.49%   91.92%   +0.43%     
==========================================
  Files         178      177       -1     
  Lines       23623    23724     +101     
==========================================
+ Hits        21613    21808     +195     
+ Misses       2010     1916      -94     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@stefan-k
Copy link
Member

Oh dear, I wanted to rebase this PR onto the new main to fix the clippy issue and somehow completely messed up and directly pushed your changes to main! Not really sure how this can happen since the main branch is protected...
Apparently I'm not doing this enough recently!

Luckily I don't have any complaints with this PR! :) Thanks a lot for your work on this and apologies for messing up the merge!

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.

3 participants