-
Notifications
You must be signed in to change notification settings - Fork 7
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
[TEST] Add EXPECT_THROW_MSG #245
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #245 +/- ##
=======================================
Coverage 95.13% 95.13%
=======================================
Files 18 18
Lines 1728 1728
=======================================
Hits 1644 1644
Misses 84 84 ☔ View full report in Codecov by Sentry. |
f056c7e
to
3295fa5
Compare
Why not using |
Because it doesn't check the message of the exception. Sometimes you want to check that the correct message is emitted, e. g., design_error is thrown in many places with different messages. |
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.
We currently do not have a repo for infrastructure stuff like we have for std stuff right? This is very valuable for seqan3 too
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 also added it to seqan3, but we don't have a repo for infra stuff
This streamlines checking that a statement throws a specific error with a specific description.
Using a macro has the advantage that we get the correct traceback and can use the existing googletest code.
The incorrect description check will also print the diff (like when comparing two strings) if googletest deems it necessary to do so.
Example output for the four cases (line numbers are correct):