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

Two different errors when REQUIRE_THROWS_AS doesn't throw #143

Closed
vid512 opened this issue Nov 28, 2023 · 3 comments · Fixed by #144
Closed

Two different errors when REQUIRE_THROWS_AS doesn't throw #143

vid512 opened this issue Nov 28, 2023 · 3 comments · Fixed by #144
Labels
bug:confirmed Something isn't working (confirmed)
Milestone

Comments

@vid512
Copy link

vid512 commented Nov 28, 2023

This code:

#define SNITCH_IMPLEMENTATION
#include "snitch_all.hpp"

#include <exception>

void func() {}

TEST_CASE("blah") {
	REQUIRE_THROWS_AS(func(), std::runtime_error);
}

outputs:

starting a with snitch v1.2.3.f605e7e
==========================================
failed: running test case "blah"
          at a.cpp:14
          std::runtime_error expected but no exception thrown
failed: running test case "blah"
          at a.cpp:14
          std::runtime_error expected but other unknown exception thrown
==========================================
error: all tests failed (1 out of 1 test cases, 2 assertions, 1.976000e-04 seconds)
@cschreib
Copy link
Member

Huho, looks like a bug. I'll take a look.

@cschreib cschreib added bug:unconfirmed Something isn't working (to be confirmed) bug:confirmed Something isn't working (confirmed) and removed bug:unconfirmed Something isn't working (to be confirmed) labels Nov 28, 2023
cschreib added a commit that referenced this issue Nov 28, 2023
@cschreib
Copy link
Member

Confirmed. A PR with a fix is in progress.

@cschreib
Copy link
Member

cschreib commented Nov 28, 2023

This is fixed on the latest main branch. Please feel free to reopen if you still experience a problem with this. Thanks for reporting the issue!

@cschreib cschreib added this to the v1.2.4 milestone Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:confirmed Something isn't working (confirmed)
Projects
None yet
2 participants