Removing broken specialization of std::hash<std::tuple>
[folly.git] / folly / test / HashTest.cpp
index 954b6b6d299a6ade605a04381f776a89e2717ba5..dc3d403c690f4d0bee23cf815db885bd12da2432 100644 (file)
@@ -19,6 +19,7 @@
 #include <gtest/gtest.h>
 #include <stdint.h>
 #include <unordered_map>
+#include <utility>
 
 using namespace folly::hash;
 
@@ -172,6 +173,16 @@ TEST(Hash, hasher) {
   EXPECT_EQ(get_default(m, 4), 5);
 }
 
+TEST(Hash, pair) {
+  auto a = std::make_pair(1, 2);
+  auto b = std::make_pair(3, 4);
+  auto c = std::make_pair(1, 2);
+  EXPECT_EQ(hash_combine(a),
+            hash_combine(c));
+  EXPECT_NE(hash_combine(b),
+            hash_combine(c));
+}
+
 TEST(Hash, hash_combine) {
   EXPECT_NE(hash_combine(1, 2), hash_combine(2, 1));
 }