#include <catch2/catch.hpp>
#include "cetlib/exception_message_matcher.h"
Go to the source code of this file.
TEST_CASE |
( |
"Contains Match" |
| ) |
|
Definition at line 7 of file exception_message_matcher_t.cc.
11 SECTION(
"Exception message matches")
18 SECTION(
"Not Thrown") { CHECK_THAT(
e, matcher); }
20 SECTION(
"Exception message does not match")
27 SECTION(
"Not Thrown") { CHECK_THAT(
e, !matcher); }
cet::coded_exception< error, detail::translate > exception
TEST_CASE |
( |
"Equals Match" |
| ) |
|
Definition at line 31 of file exception_message_matcher_t.cc.
34 Catch::Matchers::Equals(
"---- junk BEGIN\n x\n---- junk END\n"));
36 SECTION(
"Exception message matches")
43 SECTION(
"Not Thrown") { CHECK_THAT(
e, matcher); }
45 SECTION(
"Exception message does not match")
52 SECTION(
"Not Thrown") { CHECK_THAT(
e, !matcher); }
cet::coded_exception< error, detail::translate > exception
TEST_CASE |
( |
"StartsWith Match" |
| ) |
|
Definition at line 56 of file exception_message_matcher_t.cc.
59 Catch::Matchers::StartsWith(
"---- junk BEGIN\n"));
60 SECTION(
"Exception message matches")
67 SECTION(
"Not Thrown") { CHECK_THAT(
e, matcher); }
69 SECTION(
"Exception message does not match")
76 SECTION(
"Not Thrown") { CHECK_THAT(
e, !matcher); }
cet::coded_exception< error, detail::translate > exception
TEST_CASE |
( |
"EndsWith Match" |
| ) |
|
Definition at line 80 of file exception_message_matcher_t.cc.
83 Catch::Matchers::EndsWith(
"---- junk END\n"));
84 SECTION(
"Exception message matches")
91 SECTION(
"Not Thrown") { CHECK_THAT(
e, matcher); }
93 SECTION(
"Exception message does not match")
100 SECTION(
"Not Thrown") { CHECK_THAT(
e, !matcher); }
cet::coded_exception< error, detail::translate > exception
TEST_CASE |
( |
"Regex Match" |
| ) |
|
Definition at line 104 of file exception_message_matcher_t.cc.
107 Catch::Matchers::Matches(
"---- jun.*?\\b BEGIN\n.*\n.*\n"));
108 SECTION(
"Exception message matches")
115 SECTION(
"Not Thrown") { CHECK_THAT(
e, matcher); }
117 SECTION(
"Exception message does not match")
124 SECTION(
"Not Thrown") { CHECK_THAT(
e, !matcher); }
cet::coded_exception< error, detail::translate > exception
TEST_CASE |
( |
"Composed Matchers" |
| ) |
|
Definition at line 128 of file exception_message_matcher_t.cc.
131 ymatcher(Catch::Matchers::Contains(
"y\n"));
133 SECTION(
"Exception message matches")
140 SECTION(
"Not Thrown") { CHECK_THAT(
e, xmatcher && ymatcher); }
142 SECTION(
"Exception message does not match")
147 CHECK_THROWS_MATCHES(
throw e,
cet::exception, !(xmatcher && ymatcher));
149 SECTION(
"Not Thrown") { CHECK_THAT(
e, !(xmatcher && ymatcher)); }
cet::coded_exception< error, detail::translate > exception