Blame include/internal/catch_capture_matchers.cpp
|
rpm-build |
a7f80b |
/*
|
|
rpm-build |
a7f80b |
* Created by Phil on 9/8/2017.
|
|
rpm-build |
a7f80b |
* Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
|
|
rpm-build |
a7f80b |
*
|
|
rpm-build |
a7f80b |
* Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
rpm-build |
a7f80b |
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
rpm-build |
a7f80b |
*/
|
|
rpm-build |
a7f80b |
#include "catch_capture_matchers.h"
|
|
rpm-build |
a7f80b |
#include "catch_interfaces_registry_hub.h"
|
|
rpm-build |
a7f80b |
|
|
rpm-build |
a7f80b |
namespace Catch {
|
|
rpm-build |
a7f80b |
|
|
rpm-build |
a7f80b |
using StringMatcher = Matchers::Impl::MatcherBase<std::string>;
|
|
rpm-build |
a7f80b |
|
|
rpm-build |
a7f80b |
// This is the general overload that takes a any string matcher
|
|
rpm-build |
a7f80b |
// There is another overload, in catch_assertionhandler.h/.cpp, that only takes a string and infers
|
|
rpm-build |
a7f80b |
// the Equals matcher (so the header does not mention matchers)
|
|
rpm-build |
a7f80b |
void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher, StringRef matcherString ) {
|
|
rpm-build |
a7f80b |
std::string exceptionMessage = Catch::translateActiveException();
|
|
rpm-build |
a7f80b |
MatchExpr<std::string, StringMatcher const&> expr( exceptionMessage, matcher, matcherString );
|
|
rpm-build |
a7f80b |
handler.handleExpr( expr );
|
|
rpm-build |
a7f80b |
}
|
|
rpm-build |
a7f80b |
|
|
rpm-build |
a7f80b |
} // namespace Catch
|