| 125 | } |
| 126 | |
| 127 | void ExpectForestIs(std::vector<FileInfo> infos, std::vector<PT> expected_roots) { |
| 128 | auto forest = MakeForest(&infos); |
| 129 | |
| 130 | std::vector<PT> actual_roots; |
| 131 | ASSERT_OK(forest.Visit( |
| 132 | [&](Forest::Ref ref) -> Result<bool> { |
| 133 | actual_roots.emplace_back(ref, infos); |
| 134 | return false; // only visit roots |
| 135 | }, |
| 136 | [](Forest::Ref) {})); |
| 137 | |
| 138 | // visit expected and assert equality |
| 139 | EXPECT_THAT(actual_roots, ContainerEq(expected_roots)); |
| 140 | } |
| 141 | |
| 142 | TEST(Forest, Basic) { |
| 143 | ExpectForestIs({}, {}); |
no test coverage detected