std/fs/test.zig: Add statFile() tests of dangling symlink
Create a dangling symlink and check that statFile works with it.
This commit is contained in:
parent
d35bdc8ee7
commit
ff5613873f
|
@ -661,6 +661,19 @@ test "Dir.statFile" {
|
|||
}.impl);
|
||||
}
|
||||
|
||||
test "statFile on dangling symlink" {
|
||||
try testWithAllSupportedPathTypes(struct {
|
||||
fn impl(ctx: *TestContext) !void {
|
||||
const symlink_name = try ctx.transformPath("dangling-symlink");
|
||||
const symlink_target = "." ++ fs.path.sep_str ++ "doesnotexist";
|
||||
|
||||
try setupSymlink(ctx.dir, symlink_target, symlink_name, .{});
|
||||
|
||||
try std.testing.expectError(error.FileNotFound, ctx.dir.statFile(symlink_name));
|
||||
}
|
||||
}.impl);
|
||||
}
|
||||
|
||||
test "directory operations on files" {
|
||||
try testWithAllSupportedPathTypes(struct {
|
||||
fn impl(ctx: *TestContext) !void {
|
||||
|
|
Loading…
Reference in New Issue
Block a user