Commit 82ca4c04 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook GitHub Bot

Prefer EndsWith matcher in exception_wrapper test

Summary: [Folly] Prefer `EndsWith` matcher in `exception_wrapper` test so that, in case of failure, the non-matching input will be shown.

Differential Revision: D21708674

fbshipit-source-id: 022f7d64a030417b80b8796ae3d78534295509fc
parent d5ce6e82
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/ExceptionWrapper.h> #include <folly/ExceptionWrapper.h>
#include <folly/portability/GMock.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
using namespace folly; using namespace folly;
...@@ -559,21 +560,21 @@ struct OnHeapException : std::exception { ...@@ -559,21 +560,21 @@ struct OnHeapException : std::exception {
} // namespace } // namespace
TEST(ExceptionWrapper, make_wrapper_no_args) { TEST(ExceptionWrapper, make_wrapper_no_args) {
EXPECT_TRUE( EXPECT_THAT(
folly::StringPiece(folly::make_exception_wrapper<ThrownException>() folly::make_exception_wrapper<ThrownException>()
.class_name() .class_name()
.toStdString()) .toStdString(),
.endsWith("ThrownException")); testing::EndsWith("ThrownException"));
EXPECT_TRUE( EXPECT_THAT(
folly::StringPiece(folly::make_exception_wrapper<InSituException>() folly::make_exception_wrapper<InSituException>()
.class_name() .class_name()
.toStdString()) .toStdString(),
.endsWith("InSituException")); testing::EndsWith("InSituException"));
EXPECT_TRUE( EXPECT_THAT(
folly::StringPiece(folly::make_exception_wrapper<OnHeapException>() folly::make_exception_wrapper<OnHeapException>()
.class_name() .class_name()
.toStdString()) .toStdString(),
.endsWith("OnHeapException")); testing::EndsWith("OnHeapException"));
} }
namespace { namespace {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment