return ew;
}
+// For consistency with exceptionStr() functions in String.h
+inline fbstring exceptionStr(const exception_wrapper& ew) {
+ return ew.what();
+}
+
/*
* try_and_catch is a simple replacement for try {} catch(){} that allows you to
* specify which derived exceptions you would like to catch and store in an
EXPECT_EQ(i, expected);
}
}
+
+
+TEST(ExceptionWrapper, exceptionStr) {
+ auto ew = make_exception_wrapper<std::runtime_error>("argh");
+ EXPECT_EQ("std::runtime_error: argh", exceptionStr(ew));
+}