mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 04:24:33 +01:00
std.fs.test: fix rebase conflicts
This commit is contained in:
parent
3431f45031
commit
018e34271f
1 changed files with 8 additions and 7 deletions
|
|
@ -237,23 +237,24 @@ test "Dir.readLink" {
|
|||
test "Dir.readLink on non-symlinks" {
|
||||
try testWithAllSupportedPathTypes(struct {
|
||||
fn impl(ctx: *TestContext) !void {
|
||||
const io = ctx.io;
|
||||
const file_path = try ctx.transformPath("file.txt");
|
||||
try ctx.dir.writeFile(.{ .sub_path = file_path, .data = "nonsense" });
|
||||
try ctx.dir.writeFile(io, .{ .sub_path = file_path, .data = "nonsense" });
|
||||
const dir_path = try ctx.transformPath("subdir");
|
||||
try ctx.dir.makeDir(dir_path);
|
||||
try ctx.dir.makeDir(io, dir_path, .default_dir);
|
||||
|
||||
// file
|
||||
var buffer: [fs.max_path_bytes]u8 = undefined;
|
||||
try std.testing.expectError(error.NotLink, ctx.dir.readLink(file_path, &buffer));
|
||||
var buffer: [Dir.max_path_bytes]u8 = undefined;
|
||||
try std.testing.expectError(error.NotLink, ctx.dir.readLink(io, file_path, &buffer));
|
||||
if (builtin.os.tag == .windows) {
|
||||
var file_path_w = try std.os.windows.sliceToPrefixedFileW(ctx.dir.fd, file_path);
|
||||
var file_path_w = try std.os.windows.sliceToPrefixedFileW(ctx.dir.handle, file_path);
|
||||
try std.testing.expectError(error.NotLink, ctx.dir.readLinkW(file_path_w.span(), &file_path_w.data));
|
||||
}
|
||||
|
||||
// dir
|
||||
try std.testing.expectError(error.NotLink, ctx.dir.readLink(dir_path, &buffer));
|
||||
try std.testing.expectError(error.NotLink, ctx.dir.readLink(io, dir_path, &buffer));
|
||||
if (builtin.os.tag == .windows) {
|
||||
var dir_path_w = try std.os.windows.sliceToPrefixedFileW(ctx.dir.fd, dir_path);
|
||||
var dir_path_w = try std.os.windows.sliceToPrefixedFileW(ctx.dir.handle, dir_path);
|
||||
try std.testing.expectError(error.NotLink, ctx.dir.readLinkW(dir_path_w.span(), &dir_path_w.data));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue