|
|
@@ -1,6 +1,7 @@
|
|
|
#include "iterator/recursive_iterator.h"
|
|
|
|
|
|
#include <map>
|
|
|
+#include <ranges>
|
|
|
#include <tuple>
|
|
|
#include <vector>
|
|
|
|
|
|
@@ -86,11 +87,10 @@ TEST(BoundRecursiveIteratorMapTest, ElementsAreUnwrappedAsATuple) {
|
|
|
{1, {{1, {{1, 1}}}}}, {2, {{2, {{2, 2}}}, {3, {{3, 3}, {4, 4}}}}}};
|
|
|
std::vector<std::tuple<int, int, std::map<int, int>>> const expected{
|
|
|
{1, 1, {{1, 1}}}, {2, 2, {{2, 2}}}, {2, 3, {{3, 3}, {4, 4}}}};
|
|
|
- auto rit = make_recursive_iterator<2>(map);
|
|
|
|
|
|
- EXPECT_EQ((ranges::to<std::vector<std::tuple<int, int, std::map<int, int>>>>(
|
|
|
- rit, iterator::sentinel)),
|
|
|
- expected);
|
|
|
+ EXPECT_THAT(map | iterator::views::recursive_n<2> |
|
|
|
+ std::ranges::to<std::vector>(),
|
|
|
+ testing::ElementsAreArray(expected));
|
|
|
}
|
|
|
|
|
|
TEST(BoundedRecursiveIteratorMapTest, CanMutatePointedToData) {
|