Add a test for duplicate catch clauses in throw matchers, fix a couple of nitpicks.

This commit is contained in:
Vladimir Goncharov
2020-07-07 19:01:58 +03:00
parent 49d1201a7e
commit 69c510fb51
2 changed files with 7 additions and 2 deletions

View File

@@ -4738,7 +4738,6 @@ class ExceptionMatcherImpl {
ExceptionMatcherImpl(Matcher<const Err&> matcher)
: matcher_(std::move(matcher)) {}
public:
void DescribeTo(::std::ostream* os) const {
*os << "throws an exception of type " << GetTypeName<Err>();
if (matcher_.GetDescriber() != nullptr) {
@@ -4775,7 +4774,7 @@ class ExceptionMatcherImpl {
*listener << "with description \"" << err.what() << "\"";
return false;
} catch (...) {
*listener << "throws an exception of some other type";
*listener << "throws an exception of an unknown type";
return false;
}
*listener << "does not throw any exception";