functional_unittest.cc 545 B

12345678910111213141516171819202122232425
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "base/ranges/functional.h"
  5. #include "testing/gtest/include/gtest/gtest.h"
  6. namespace base {
  7. TEST(RangesTest, EqualTo) {
  8. ranges::equal_to eq;
  9. EXPECT_TRUE(eq(0, 0));
  10. EXPECT_FALSE(eq(0, 1));
  11. EXPECT_FALSE(eq(1, 0));
  12. }
  13. TEST(RangesTest, Less) {
  14. ranges::less lt;
  15. EXPECT_FALSE(lt(0, 0));
  16. EXPECT_TRUE(lt(0, 1));
  17. EXPECT_FALSE(lt(1, 0));
  18. }
  19. } // namespace base