authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-12-19 10:07:56-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-12-23 22:15:11-08:00
log018e34271fe58e540dc46e8bca529ce399625bef
tree280e3df33e81da7c5a09c6de567047498e286b83
parent3431f4503116e06b542eedf9c9bad6f769af3ebc

std.fs.test: fix rebase conflicts


1 files changed, 8 insertions(+), 7 deletions(-)

lib/std/fs/test.zig+8-7
......@@ -237,23 +237,24 @@ test "Dir.readLink" {
237237test "Dir.readLink on non-symlinks" {
238238 try testWithAllSupportedPathTypes(struct {
239239 fn impl(ctx: *TestContext) !void {
240 const io = ctx.io;
240241 const file_path = try ctx.transformPath("file.txt");
241 try ctx.dir.writeFile(.{ .sub_path = file_path, .data = "nonsense" });
242 try ctx.dir.writeFile(io, .{ .sub_path = file_path, .data = "nonsense" });
242243 const dir_path = try ctx.transformPath("subdir");
243 try ctx.dir.makeDir(dir_path);
244 try ctx.dir.makeDir(io, dir_path, .default_dir);
244245
245246 // file
246 var buffer: [fs.max_path_bytes]u8 = undefined;
247 try std.testing.expectError(error.NotLink, ctx.dir.readLink(file_path, &buffer));
247 var buffer: [Dir.max_path_bytes]u8 = undefined;
248 try std.testing.expectError(error.NotLink, ctx.dir.readLink(io, file_path, &buffer));
248249 if (builtin.os.tag == .windows) {
249 var file_path_w = try std.os.windows.sliceToPrefixedFileW(ctx.dir.fd, file_path);
250 var file_path_w = try std.os.windows.sliceToPrefixedFileW(ctx.dir.handle, file_path);
250251 try std.testing.expectError(error.NotLink, ctx.dir.readLinkW(file_path_w.span(), &file_path_w.data));
251252 }
252253
253254 // dir
254 try std.testing.expectError(error.NotLink, ctx.dir.readLink(dir_path, &buffer));
255 try std.testing.expectError(error.NotLink, ctx.dir.readLink(io, dir_path, &buffer));
255256 if (builtin.os.tag == .windows) {
256 var dir_path_w = try std.os.windows.sliceToPrefixedFileW(ctx.dir.fd, dir_path);
257 var dir_path_w = try std.os.windows.sliceToPrefixedFileW(ctx.dir.handle, dir_path);
257258 try std.testing.expectError(error.NotLink, ctx.dir.readLinkW(dir_path_w.span(), &dir_path_w.data));
258259 }
259260 }