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

Unified Diff: base/functional_unittest.cc

Issue 2944523002: Improving flat containers interface. (Closed)
Patch Set: Review, round 3. 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/functional_unittest.cc
diff --git a/base/functional_unittest.cc b/base/functional_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0dec075a1ccd70697d9e25229112aba54d59bcbb
--- /dev/null
+++ b/base/functional_unittest.cc
@@ -0,0 +1,26 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/functional.h"
+
+#include "base/containers/container_test_utils.h"
+#include "base/containers/flat_tree.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace base {
+
+namespace {
+
+TEST(Functional, 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
+
+} // namespace base
« base/functional.h ('K') | « base/functional.h ('k') | base/template_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698