Chromium Code Reviews| 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 |