exception_category_matcher_t.cc
Go to the documentation of this file.
1 #include <catch2/catch.hpp>
2 
4 
6 
7 TEST_CASE("Category matcher")
8 {
9  exception_category_matcher matcher("junk");
10  SECTION("Exception category matches")
11  {
12  cet::exception e("junk");
13  SECTION("Thrown")
14  {
15  CHECK_THROWS_MATCHES(throw e, cet::exception, matcher);
16  }
17  SECTION("Not Thrown") { CHECK_THAT(e, matcher); }
18  }
19  SECTION("Exception category does not match")
20  {
21  cet::exception e("junky");
22  SECTION("Thrown")
23  {
24  CHECK_THROWS_MATCHES(throw e, cet::exception, !matcher);
25  }
26  SECTION("Not Thrown") { CHECK_THAT(e, !matcher); }
27  }
28 }
const double e
TEST_CASE("Category matcher")
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33