File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -954,6 +954,10 @@ test ". and .. in fs.Dir functions" {
954954 renamed_file .close ();
955955 try tmp .dir .deleteFile ("./subdir/../rename" );
956956
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+
957961 try tmp .dir .deleteDir ("./subdir" );
958962}
959963
@@ -991,5 +995,12 @@ test ". and .. in absolute functions" {
991995 renamed_file .close ();
992996 try fs .deleteFileAbsolute (renamed_file_path );
993997
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+
9941005 try fs .deleteDirAbsolute (subdir_path );
9951006}
You can’t perform that action at this time.
0 commit comments