Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/containers/flat_set.h" | 5 #include "base/containers/flat_set.h" |
| 6 | 6 |
| 7 // Following tests are ported and extended tests from libcpp for std::set. | 7 // Following tests are ported and extended tests from libcpp for std::set. |
| 8 // They can be found here: | 8 // They can be found here: |
| 9 // https://github.com/llvm-mirror/libcxx/tree/master/test/std/containers/associa tive/set | 9 // https://github.com/llvm-mirror/libcxx/tree/master/test/std/containers/associa tive/set |
| 10 // | 10 // |
| (...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1235 | 1235 |
| 1236 EXPECT_EQ(biggest, biggest); | 1236 EXPECT_EQ(biggest, biggest); |
| 1237 EXPECT_NE(biggest, smallest); | 1237 EXPECT_NE(biggest, smallest); |
| 1238 EXPECT_LT(smallest, middle); | 1238 EXPECT_LT(smallest, middle); |
| 1239 EXPECT_LE(smallest, middle); | 1239 EXPECT_LE(smallest, middle); |
| 1240 EXPECT_LE(middle, middle); | 1240 EXPECT_LE(middle, middle); |
| 1241 EXPECT_GT(biggest, middle); | 1241 EXPECT_GT(biggest, middle); |
| 1242 EXPECT_GE(biggest, middle); | 1242 EXPECT_GE(biggest, middle); |
| 1243 EXPECT_GE(biggest, biggest); | 1243 EXPECT_GE(biggest, biggest); |
| 1244 } | 1244 } |
| 1245 | |
| 1246 // void EraseIf(flat_set) | |
|
danakj
2017/03/06 16:21:56
This comment is exactly the test name, just remove
| |
| 1247 | |
| 1248 TEST(FlatSet, EraseIf) { | |
| 1249 IntSet x; | |
| 1250 base::EraseIf(x, [](int) { return false; }); | |
| 1251 EXPECT_THAT(x, ElementsAre()); | |
| 1252 | |
| 1253 x = {1, 2, 3}; | |
| 1254 base::EraseIf(x, [](int elem) { return !(elem & 1); }); | |
| 1255 EXPECT_THAT(x, ElementsAre(1, 3)); | |
| 1256 | |
| 1257 x = {1, 2, 3, 4}; | |
| 1258 base::EraseIf(x, [](int elem) { return elem & 1; }); | |
| 1259 EXPECT_THAT(x, ElementsAre(2, 4)); | |
| 1260 } | |
| OLD | NEW |