Skip to content

Commit

Permalink
[ziglang#12474]: Update 'makeOpenPath parent dirs do not exist' test …
Browse files Browse the repository at this point in the history
…case

See this discussion ziglang#14833 (comment) for more Info
  • Loading branch information
QusaiHroub committed Jun 19, 2023
1 parent eab9efb commit 4702da4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/std/fs/test.zig
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,15 @@ test "file operations on directories" {
}

test "makeOpenPath parent dirs do not exist" {
if (builtin.os.tag == .wasi) return error.SkipZigTest;
var tmp_dir = tmpDir(.{});
defer tmp_dir.cleanup();

var dir = try fs.cwd().makeOpenPath("root_dir/parent_dir/some_dir", .{});
defer dir.close();
var dir = try tmp_dir.dir.makeOpenPath("root_dir/parent_dir/some_dir", .{});
dir.close();

// double check that the full directory structure was created
var dir_verification = try tmp_dir.dir.openDir("root_dir/parent_dir/some_dir", .{});
dir_verification.close();
}

test "deleteDir" {
Expand Down

0 comments on commit 4702da4

Please sign in to comment.