| 140 | } |
| 141 | |
| 142 | TEST(Forest, Basic) { |
| 143 | ExpectForestIs({}, {}); |
| 144 | |
| 145 | ExpectForestIs({FileInfo::File("aa")}, {PT("aa")}); |
| 146 | ExpectForestIs({FileInfo::Dir("AA")}, {PT("AA", {})}); |
| 147 | ExpectForestIs({FileInfo::Dir("AA"), FileInfo::File("AA/aa")}, |
| 148 | {PT("AA", {PT("AA/aa")})}); |
| 149 | ExpectForestIs({FileInfo::Dir("AA"), FileInfo::Dir("AA/BB"), FileInfo::File("AA/BB/0")}, |
| 150 | {PT("AA", {PT("AA/BB", {PT("AA/BB/0")})})}); |
| 151 | |
| 152 | // Missing parent can still find ancestor. |
| 153 | ExpectForestIs({FileInfo::Dir("AA"), FileInfo::File("AA/BB/bb")}, |
| 154 | {PT("AA", {PT("AA/BB/bb")})}); |
| 155 | |
| 156 | // Ancestors should link to parent regardless of ordering. |
| 157 | ExpectForestIs({FileInfo::File("AA/aa"), FileInfo::Dir("AA")}, |
| 158 | {PT("AA", {PT("AA/aa")})}); |
| 159 | |
| 160 | // Multiple roots are supported. |
| 161 | ExpectForestIs({FileInfo::File("aa"), FileInfo::File("bb")}, {PT("aa"), PT("bb")}); |
| 162 | ExpectForestIs({FileInfo::File("00"), FileInfo::Dir("AA"), FileInfo::File("AA/aa"), |
| 163 | FileInfo::File("BB/bb")}, |
| 164 | {PT("00"), PT("AA", {PT("AA/aa")}), PT("BB/bb")}); |
| 165 | ExpectForestIs({FileInfo::Dir("AA"), FileInfo::Dir("AA/BB"), FileInfo::File("AA/BB/0"), |
| 166 | FileInfo::Dir("CC"), FileInfo::Dir("CC/BB"), FileInfo::File("CC/BB/0")}, |
| 167 | {PT("AA", {PT("AA/BB", {PT("AA/BB/0")})}), |
| 168 | PT("CC", {PT("CC/BB", {PT("CC/BB/0")})})}); |
| 169 | } |
| 170 | |
| 171 | TEST(Forest, HourlyETL) { |
| 172 | // This test mimics a scenario where an ETL dumps hourly files in a structure |
nothing calls this directly
no test coverage detected