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

Unified Diff: base/template_util_unittest.cc

Issue 2944523002: Improving flat containers interface. (Closed)
Patch Set: Other platforms compilation 2. Created 3 years, 5 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
« no previous file with comments | « base/template_util.h ('k') | base/test/move_only_int.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/template_util_unittest.cc
diff --git a/base/template_util_unittest.cc b/base/template_util_unittest.cc
index 476d6bb7375c70eb13b9fdf23bbef56af0a75e3f..75c47b038716eabda42e3e69bb9ce4240258110f 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 {
@@ -91,4 +93,14 @@ static_assert(!base::is_trivially_copyable<TrivialCopyButWithDestructor>::value,
"trivially copyable");
} // namespace
+
+TEST(TemplateUtil, Less) {
+ 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
« no previous file with comments | « base/template_util.h ('k') | base/test/move_only_int.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698