diff options
| author | Phil Nash | 2017-08-09 12:10:14 +0100 |
|---|---|---|
| committer | Phil Nash | 2017-08-09 12:10:14 +0100 |
| commit | ee9b19efd3737afc93e14023cc0b4a9fd2a21b7c (patch) | |
| tree | 6bee3b9ac3be2a8057fa767bab44386c12a7b13a /include/internal/catch_assertionhandler.cpp | |
| parent | b59e0ed48a4d94f9e595a5936434e9bad7834ece (diff) | |
| download | catch3-ee9b19efd3737afc93e14023cc0b4a9fd2a21b7c.tar.gz | |
Moved matcher-based capture macros into their own file
- this file excluded from the CATCH_CONFIG_DISABLE_MATCHERS path.
- matchers are always compiled in to the impl file
- _THROWS_WITH macros are still available with matchers disabled - but only the ones that take a string
- tests that use matchers have #ifdefs, so the whole SelfTest project can compile with matchers disable.
Diffstat (limited to 'include/internal/catch_assertionhandler.cpp')
| -rw-r--r-- | include/internal/catch_assertionhandler.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/include/internal/catch_assertionhandler.cpp b/include/internal/catch_assertionhandler.cpp index ea4f75af..9e7c8453 100644 --- a/include/internal/catch_assertionhandler.cpp +++ b/include/internal/catch_assertionhandler.cpp @@ -14,7 +14,7 @@ #include "catch_context.h" #include "catch_debugger.h" #include "catch_interfaces_registry_hub.h" -#include "catch_matchers_string.h" +#include "catch_capture_matchers.h" #include <cassert> @@ -138,12 +138,8 @@ 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 ); - } + // This is the overload that takes a string and infers the Equals matcher from it + // The more general overload, that takes any string matcher, is in catch_capture_matchers.cpp void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef matcherString ) { handleExceptionMatchExpr( handler, Matchers::Equals( str ), matcherString ); } |