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