| ... | @@ -237,23 +237,24 @@ test "Dir.readLink" { | ... | @@ -237,23 +237,24 @@ test "Dir.readLink" { |
| 237 | test "Dir.readLink on non-symlinks" { | 237 | test "Dir.readLink on non-symlinks" { |
| 238 | try testWithAllSupportedPathTypes(struct { | 238 | try testWithAllSupportedPathTypes(struct { |
| 239 | fn impl(ctx: *TestContext) !void { | 239 | fn impl(ctx: *TestContext) !void { |
| | 240 | const io = ctx.io; |
| 240 | const file_path = try ctx.transformPath("file.txt"); | 241 | 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" }); |
| 242 | const dir_path = try ctx.transformPath("subdir"); | 243 | const dir_path = try ctx.transformPath("subdir"); |
| 243 | try ctx.dir.makeDir(dir_path); | 244 | try ctx.dir.makeDir(io, dir_path, .default_dir); |
| 244 | | 245 | |
| 245 | // file | 246 | // file |
| 246 | var buffer: [fs.max_path_bytes]u8 = undefined; | 247 | var buffer: [Dir.max_path_bytes]u8 = undefined; |
| 247 | try std.testing.expectError(error.NotLink, ctx.dir.readLink(file_path, &buffer)); | 248 | try std.testing.expectError(error.NotLink, ctx.dir.readLink(io, file_path, &buffer)); |
| 248 | if (builtin.os.tag == .windows) { | 249 | 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); |
| 250 | try std.testing.expectError(error.NotLink, ctx.dir.readLinkW(file_path_w.span(), &file_path_w.data)); | 251 | try std.testing.expectError(error.NotLink, ctx.dir.readLinkW(file_path_w.span(), &file_path_w.data)); |
| 251 | } | 252 | } |
| 252 | | 253 | |
| 253 | // dir | 254 | // 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)); |
| 255 | if (builtin.os.tag == .windows) { | 256 | 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); |
| 257 | try std.testing.expectError(error.NotLink, ctx.dir.readLinkW(dir_path_w.span(), &dir_path_w.data)); | 258 | try std.testing.expectError(error.NotLink, ctx.dir.readLinkW(dir_path_w.span(), &dir_path_w.data)); |
| 258 | } | 259 | } |
| 259 | } | 260 | } |