Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include/internal/catch_assertionhandler.cpp
diff options
context:
space:
mode:
authorPhil Nash2017-08-09 00:44:30 +0100
committerPhil Nash2017-08-09 00:44:30 +0100
commit27fd8f80bd883df36c243bc355429977fd665c50 (patch)
tree4f3cb43a3f40c0c6837a77985fb1508e141db67a /include/internal/catch_assertionhandler.cpp
parentef4fa56b71e7013fe39609abfb25819b618c1177 (diff)
downloadcatch3-27fd8f80bd883df36c243bc355429977fd665c50.tar.gz
Integrated INTERNAL_CATCH_THROWS_STR_MATCHES with new AssertionHandler
Diffstat (limited to 'include/internal/catch_assertionhandler.cpp')
-rw-r--r--include/internal/catch_assertionhandler.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/internal/catch_assertionhandler.cpp b/include/internal/catch_assertionhandler.cpp
index 8d99e3d0..26f727a9 100644
--- a/include/internal/catch_assertionhandler.cpp
+++ b/include/internal/catch_assertionhandler.cpp
@@ -13,6 +13,7 @@
#include "catch_context.h"
#include "catch_debugger.h"
#include "catch_interfaces_registry_hub.h"
+#include "catch_matchers_string.h"
#include <cassert>
@@ -140,5 +141,14 @@ namespace Catch {
m_inExceptionGuard = false;
}
+ using StringMatcher = Matchers::Impl::MatcherBase<std::string>;
+
+ void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher, StringRef matcherString ) {
+ MatchExpr<std::string, StringMatcher const&> expr( Catch::translateActiveException(), matcher, matcherString );
+ handler.handle( expr );
+ }
+ void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef matcherString ) {
+ handleExceptionMatchExpr( handler, Matchers::Equals( str ), matcherString );
+ }
} // namespace Catch