diff options
| author | Phil Nash | 2017-08-09 00:44:30 +0100 |
|---|---|---|
| committer | Phil Nash | 2017-08-09 00:44:30 +0100 |
| commit | 27fd8f80bd883df36c243bc355429977fd665c50 (patch) | |
| tree | 4f3cb43a3f40c0c6837a77985fb1508e141db67a /include/internal/catch_assertionhandler.cpp | |
| parent | ef4fa56b71e7013fe39609abfb25819b618c1177 (diff) | |
| download | catch3-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.cpp | 10 |
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 |