We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d35bdc8 commit ff56138Copy full SHA for ff56138
lib/std/fs/test.zig
@@ -661,6 +661,19 @@ test "Dir.statFile" {
661
}.impl);
662
}
663
664
+test "statFile on dangling symlink" {
665
+ try testWithAllSupportedPathTypes(struct {
666
+ fn impl(ctx: *TestContext) !void {
667
+ const symlink_name = try ctx.transformPath("dangling-symlink");
668
+ const symlink_target = "." ++ fs.path.sep_str ++ "doesnotexist";
669
+
670
+ try setupSymlink(ctx.dir, symlink_target, symlink_name, .{});
671
672
+ try std.testing.expectError(error.FileNotFound, ctx.dir.statFile(symlink_name));
673
+ }
674
+ }.impl);
675
+}
676
677
test "directory operations on files" {
678
try testWithAllSupportedPathTypes(struct {
679
fn impl(ctx: *TestContext) !void {
0 commit comments