| ... | ... | @@ -1823,13 +1823,13 @@ test "selective walker, skip entries that start with ." { |
| 1823 | 1823 | |
| 1824 | 1824 | // iteration order of walker is undefined, so need lookup maps to check against |
| 1825 | 1825 | |
| 1826 | | const expected_paths = std.StaticStringMap(void).initComptime(.{ |
| 1827 | | .{"dir1"}, |
| 1828 | | .{"dir1" ++ fs.path.sep_str ++ "foo"}, |
| 1829 | | .{"a"}, |
| 1830 | | .{"a" ++ fs.path.sep_str ++ "b"}, |
| 1831 | | .{"a" ++ fs.path.sep_str ++ "b" ++ fs.path.sep_str ++ "c"}, |
| 1832 | | .{"a" ++ fs.path.sep_str ++ "baz"}, |
| 1826 | const expected_paths = std.StaticStringMap(usize).initComptime(.{ |
| 1827 | .{ "dir1", 1 }, |
| 1828 | .{ "dir1" ++ fs.path.sep_str ++ "foo", 2 }, |
| 1829 | .{ "a", 1 }, |
| 1830 | .{ "a" ++ fs.path.sep_str ++ "b", 2 }, |
| 1831 | .{ "a" ++ fs.path.sep_str ++ "b" ++ fs.path.sep_str ++ "c", 3 }, |
| 1832 | .{ "a" ++ fs.path.sep_str ++ "baz", 2 }, |
| 1833 | 1833 | }); |
| 1834 | 1834 | |
| 1835 | 1835 | const expected_basenames = std.StaticStringMap(void).initComptime(.{ |
| ... | ... | @@ -1863,6 +1863,11 @@ test "selective walker, skip entries that start with ." { |
| 1863 | 1863 | std.debug.print("found unexpected path: {f}\n", .{std.ascii.hexEscape(entry.path, .lower)}); |
| 1864 | 1864 | return err; |
| 1865 | 1865 | }; |
| 1866 | |
| 1867 | testing.expectEqual(expected_paths.get(entry.path).?, walker.depth()) catch |err| { |
| 1868 | std.debug.print("path reported unexpected depth: {f}, {d}", .{ std.ascii.hexEscape(entry.path, .lower), walker.depth() }); |
| 1869 | return err; |
| 1870 | }; |
| 1866 | 1871 | // make sure that the entry.dir is the containing dir |
| 1867 | 1872 | var entry_dir = try entry.dir.openDir(entry.basename, .{}); |
| 1868 | 1873 | defer entry_dir.close(); |