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 @@
#include <folly/Conv.h>
#include <folly/ExceptionWrapper.h>
#include <folly/portability/GMock.h>
#include <folly/portability/GTest.h>
using namespace folly;
......@@ -559,21 +560,21 @@ struct OnHeapException : std::exception {
} // namespace
TEST(ExceptionWrapper, make_wrapper_no_args) {
EXPECT_TRUE(
folly::StringPiece(folly::make_exception_wrapper<ThrownException>()
EXPECT_THAT(
folly::make_exception_wrapper<ThrownException>()
.class_name()
.toStdString())
.endsWith("ThrownException"));
EXPECT_TRUE(
folly::StringPiece(folly::make_exception_wrapper<InSituException>()
.toStdString(),
testing::EndsWith("ThrownException"));
EXPECT_THAT(
folly::make_exception_wrapper<InSituException>()
.class_name()
.toStdString())
.endsWith("InSituException"));
EXPECT_TRUE(
folly::StringPiece(folly::make_exception_wrapper<OnHeapException>()
.toStdString(),
testing::EndsWith("InSituException"));
EXPECT_THAT(
folly::make_exception_wrapper<OnHeapException>()
.class_name()
.toStdString())
.endsWith("OnHeapException"));
.toStdString(),
testing::EndsWith("OnHeapException"));
}
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