googletest's PrintTo for folly strings
Summary: Prints StringPiece/FixedString/fbstring like a string and not like a vector of char when implicitly printed by googletest/googlemock. The order of printing precedence within googletest is: * ADL `PrintTo(T const&, ostream*)` * Gtest's container-printer for anything that looks like a container * ADL `ostream& operator<<(ostream&, T const&)` Unfortunately you need to include the <folly/test/TestUtils.h> header in every test to have this functionality. The googletest mechanism for overloading this means we can't do it in the main headers without introducing a dependency from them to googletest. Reviewed By: yfeldblum, luciang Differential Revision: D13306040 fbshipit-source-id: 4e8252d377835dad04625d84a0cae7c0713ce8af
Showing
folly/test/TestUtilsTest.cpp
0 → 100644
Please register or sign in to comment