Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(812)

Unified Diff: base/template_util_unittest.cc

Issue 2944523002: Improving flat containers interface. (Closed)
Patch Set: Hopefuly, fix for git issue. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/template_util_unittest.cc
diff --git a/base/template_util_unittest.cc b/base/template_util_unittest.cc
index 70d28c8e4e2806fdbcb48cc7402ac75ba2c5c117..f7db2548458027cf110a4c8b3365e78ae72610db 100644
--- a/base/template_util_unittest.cc
+++ b/base/template_util_unittest.cc
@@ -6,6 +6,8 @@
#include <string>
+#include "base/containers/flat_tree.h"
+#include "base/test/move_only_int.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
@@ -70,4 +72,14 @@ static_assert(
"struct with operator<< should be printable by const ref");
} // namespace
+
+TEST(Functors, Less) {
danakj 2017/06/27 23:48:25 nit: TemplateUtil.Less would be easier to find
dyaroshev 2017/06/28 09:13:59 Done.
+ using ExplicitInt = base::MoveOnlyInt;
+ EXPECT_TRUE(base::less()(ExplicitInt(3), 4));
+ EXPECT_FALSE(base::less()(4, ExplicitInt(3)));
+ EXPECT_TRUE(base::less()(3, 4));
+
+ static_assert(base::internal::IsTransparentCompare<base::less>::value, "");
+}
+
} // namespace base

Powered by Google App Engine
This is Rietveld 408576698