| ... | @@ -954,6 +954,10 @@ test ". and .. in fs.Dir functions" { | ... | @@ -954,6 +954,10 @@ test ". and .. in fs.Dir functions" { |
| 954 | renamed_file.close(); | 954 | renamed_file.close(); |
| 955 | try tmp.dir.deleteFile("./subdir/../rename"); | 955 | try tmp.dir.deleteFile("./subdir/../rename"); |
| 956 | | 956 | |
| | 957 | try tmp.dir.writeFile("./subdir/../update", "something"); |
| | 958 | const prev_status = try tmp.dir.updateFile("./subdir/../file", tmp.dir, "./subdir/../update", .{}); |
| | 959 | try testing.expectEqual(fs.PrevStatus.stale, prev_status); |
| | 960 | |
| 957 | try tmp.dir.deleteDir("./subdir"); | 961 | try tmp.dir.deleteDir("./subdir"); |
| 958 | } | 962 | } |
| 959 | | 963 | |
| ... | @@ -991,5 +995,12 @@ test ". and .. in absolute functions" { | ... | @@ -991,5 +995,12 @@ test ". and .. in absolute functions" { |
| 991 | renamed_file.close(); | 995 | renamed_file.close(); |
| 992 | try fs.deleteFileAbsolute(renamed_file_path); | 996 | try fs.deleteFileAbsolute(renamed_file_path); |
| 993 | | 997 | |
| | 998 | const update_file_path = try fs.path.join(allocator, &[_][]const u8{ subdir_path, "../update" }); |
| | 999 | const update_file = try fs.createFileAbsolute(update_file_path, .{}); |
| | 1000 | try update_file.writeAll("something"); |
| | 1001 | update_file.close(); |
| | 1002 | const prev_status = try fs.updateFileAbsolute(created_file_path, update_file_path, .{}); |
| | 1003 | try testing.expectEqual(fs.PrevStatus.stale, prev_status); |
| | 1004 | |
| 994 | try fs.deleteDirAbsolute(subdir_path); | 1005 | try fs.deleteDirAbsolute(subdir_path); |
| 995 | } | 1006 | } |