| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/stl_util.h" | 5 #include "base/stl_util.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 a3.insert(5); | 231 a3.insert(5); |
| 232 | 232 |
| 233 EXPECT_TRUE(STLIncludes<std::set<int> >(a1, a2)); | 233 EXPECT_TRUE(STLIncludes<std::set<int> >(a1, a2)); |
| 234 EXPECT_FALSE(STLIncludes<std::set<int> >(a1, a3)); | 234 EXPECT_FALSE(STLIncludes<std::set<int> >(a1, a3)); |
| 235 EXPECT_FALSE(STLIncludes<std::set<int> >(a2, a1)); | 235 EXPECT_FALSE(STLIncludes<std::set<int> >(a2, a1)); |
| 236 EXPECT_FALSE(STLIncludes<std::set<int> >(a2, a3)); | 236 EXPECT_FALSE(STLIncludes<std::set<int> >(a2, a3)); |
| 237 EXPECT_FALSE(STLIncludes<std::set<int> >(a3, a1)); | 237 EXPECT_FALSE(STLIncludes<std::set<int> >(a3, a1)); |
| 238 EXPECT_TRUE(STLIncludes<std::set<int> >(a3, a2)); | 238 EXPECT_TRUE(STLIncludes<std::set<int> >(a3, a2)); |
| 239 } | 239 } |
| 240 | 240 |
| 241 TEST(STLUtilTest, LambdaForEach) { |
| 242 std::vector<int> numbers; |
| 243 numbers.push_back(1); |
| 244 numbers.push_back(2); |
| 245 std::for_each(numbers.begin(), numbers.end(), |
| 246 [](int i) { LOG(INFO) << i; }); |
| 247 } |
| 248 |
| 241 } // namespace | 249 } // namespace |
| 242 } // namespace base | 250 } // namespace base |
| OLD | NEW |