mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
test: enter after check to preserve depth
This commit is contained in:
parent
a26a654c55
commit
7bee39c1fd
1 changed files with 6 additions and 5 deletions
|
|
@ -1851,10 +1851,6 @@ test "selective walker, skip entries that start with ." {
|
|||
var num_walked: usize = 0;
|
||||
while (try walker.next()) |entry| {
|
||||
if (entry.basename[0] == '.') continue;
|
||||
if (entry.kind == .directory) {
|
||||
try walker.enter(entry);
|
||||
}
|
||||
|
||||
testing.expect(expected_basenames.has(entry.basename)) catch |err| {
|
||||
std.debug.print("found unexpected basename: {f}\n", .{std.ascii.hexEscape(entry.basename, .lower)});
|
||||
return err;
|
||||
|
|
@ -1865,9 +1861,14 @@ test "selective walker, skip entries that start with ." {
|
|||
};
|
||||
|
||||
testing.expectEqual(expected_paths.get(entry.path).?, walker.depth()) catch |err| {
|
||||
std.debug.print("path reported unexpected depth: {f}, {d}", .{ std.ascii.hexEscape(entry.path, .lower), walker.depth() });
|
||||
std.debug.print("path reported unexpected depth: {f}, {d}, expected {d}\n", .{ std.ascii.hexEscape(entry.path, .lower), walker.depth(), expected_paths.get(entry.path).? });
|
||||
return err;
|
||||
};
|
||||
|
||||
if (entry.kind == .directory) {
|
||||
try walker.enter(entry);
|
||||
}
|
||||
|
||||
// make sure that the entry.dir is the containing dir
|
||||
var entry_dir = try entry.dir.openDir(entry.basename, .{});
|
||||
defer entry_dir.close();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue