Home | History | Annotate | Download | only in internal
      1 /*
      2  *  Created by Phil on 9/8/2017.
      3  *  Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
      4  *
      5  *  Distributed under the Boost Software License, Version 1.0. (See accompanying
      6  *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
      7  */
      8 #include "catch_capture_matchers.h"
      9 #include "catch_interfaces_registry_hub.h"
     10 
     11 namespace Catch {
     12 
     13     using StringMatcher = Matchers::Impl::MatcherBase<std::string>;
     14 
     15     // This is the general overload that takes a any string matcher
     16     // There is another overload, in catch_assertionhandler.h/.cpp, that only takes a string and infers
     17     // the Equals matcher (so the header does not mention matchers)
     18     void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher, StringRef const& matcherString  ) {
     19         std::string exceptionMessage = Catch::translateActiveException();
     20         MatchExpr<std::string, StringMatcher const&> expr( exceptionMessage, matcher, matcherString );
     21         handler.handleExpr( expr );
     22     }
     23 
     24 } // namespace Catch
     25