Commit 9f56897b authored by Nathan Bronson's avatar Nathan Bronson Committed by Facebook Github Bot

test auto-heterogeneity for fbstring

Summary:
This extends the unit tests for auto-transparent hash and
equality to verify that they apply to fbstring.

Reviewed By: froody

Differential Revision: D12908619

fbshipit-source-id: cdff815be6cb8fda6695cf745b20181f81ee0dd9
parent 69b52db2
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <set> #include <set>
#include <vector> #include <vector>
#include <folly/FBString.h>
#include <folly/Portability.h> #include <folly/Portability.h>
#include <folly/Range.h> #include <folly/Range.h>
#include <folly/Traits.h> #include <folly/Traits.h>
...@@ -82,6 +83,8 @@ TEST(HeterogeneousAccess, transparentIsSelected) { ...@@ -82,6 +83,8 @@ TEST(HeterogeneousAccess, transparentIsSelected) {
checkTransparent<std::u32string_view>(); checkTransparent<std::u32string_view>();
#endif #endif
checkTransparent<fbstring>();
checkTransparent<StringPiece>(); checkTransparent<StringPiece>();
checkTransparent<MutableStringPiece>(); checkTransparent<MutableStringPiece>();
...@@ -210,6 +213,7 @@ TEST(HeterogeneousAccess, transparentMatches) { ...@@ -210,6 +213,7 @@ TEST(HeterogeneousAccess, transparentMatches) {
runTestMatches<std::wstring>(L"abcd"); runTestMatches<std::wstring>(L"abcd");
runTestMatches<std::u16string>(u"abcd"); runTestMatches<std::u16string>(u"abcd");
runTestMatches<std::u32string>(U"abcd"); runTestMatches<std::u32string>(U"abcd");
runTestMatches<fbstring>("abcd");
runTestMatches<std::vector<int>>({1, 2, 3, 4}); runTestMatches<std::vector<int>>({1, 2, 3, 4});
static_assert( static_assert(
......
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