| ... | @@ -661,6 +661,19 @@ test "Dir.statFile" { | ... | @@ -661,6 +661,19 @@ test "Dir.statFile" { |
| 661 | }.impl); | 661 | }.impl); |
| 662 | } | 662 | } |
| 663 | | 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 | |
| 664 | test "directory operations on files" { | 677 | test "directory operations on files" { |
| 665 | try testWithAllSupportedPathTypes(struct { | 678 | try testWithAllSupportedPathTypes(struct { |
| 666 | fn impl(ctx: *TestContext) !void { | 679 | fn impl(ctx: *TestContext) !void { |