BurntSushi / walkdir

Rust library for walking directories recursively.
The Unlicense
1.21k stars 106 forks source link

tests: add contents_first with min & max depth #164

Open danielparks opened 1 year ago

danielparks commented 1 year ago

This just adds contents_first(true) versions of the existing tests for min and max depth. Given that handling contents first can be a bit confusing, it seemed wise to test it more thoroughly.

For symmetry, this switches the existing min and max depth tests to use path() instead of sorted_paths(). Because all of the test directories only have one entry, there should never be an issue with entries being returned in a different, but still correct, order.


This isn’t strictly necessary, but when I was working on #163 I was concerned that min and max depth might break with contents_first. No worries if you’d prefer not to add these, or if you’d prefer to keep sorted_paths().