2017-08-09 12:10:14 +01:00
|
|
|
/*
|
|
|
|
|
* Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
|
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
|
*/
|
2020-03-30 10:34:21 +02:00
|
|
|
#include <catch2/internal/catch_capture_matchers.hpp>
|
2020-03-01 19:59:18 +01:00
|
|
|
#include <catch2/matchers/catch_matchers.hpp>
|
2020-03-30 10:34:21 +02:00
|
|
|
#include <catch2/interfaces/catch_interfaces_registry_hub.hpp>
|
2017-08-09 12:10:14 +01:00
|
|
|
|
|
|
|
|
namespace Catch {
|
|
|
|
|
|
|
|
|
|
// This is the general overload that takes a any string matcher
|
2018-03-07 04:08:35 -05:00
|
|
|
// There is another overload, in catch_assertionhandler.h/.cpp, that only takes a string and infers
|
2017-08-09 12:10:14 +01:00
|
|
|
// the Equals matcher (so the header does not mention matchers)
|
2018-07-23 13:49:29 +02:00
|
|
|
void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher, StringRef const& matcherString ) {
|
2017-08-17 19:19:17 +01:00
|
|
|
std::string exceptionMessage = Catch::translateActiveException();
|
2020-02-16 11:19:10 +01:00
|
|
|
MatchExpr<std::string, StringMatcher const&> expr( std::move(exceptionMessage), matcher, matcherString );
|
2017-11-24 19:15:46 +00:00
|
|
|
handler.handleExpr( expr );
|
2017-08-09 12:10:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Catch
|