Skip to content

Commit

Permalink
drop the file
Browse files Browse the repository at this point in the history
Signed-off-by: Tarek <[email protected]>
  • Loading branch information
tareknaser committed Jun 12, 2024
1 parent 11ebaae commit 5c47dd0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions fs-storage/src/file_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,16 +375,24 @@ mod tests {
.expect("Failed to write to file");
file.flush().expect("Failed to flush file");

// Drop the file handle
drop(file);

let timestamp_before = fs::metadata(&storage_path)
.expect("Failed to get metadata")
.modified()
.expect("Failed to get modified time");

let mut file =
fs::File::create(&storage_path).expect("Failed to create file");
// write to the file again
file.write_all(b"test2")
.expect("Failed to write to file");
file.flush().expect("Failed to flush file");

// Drop the file handle
drop(file);

let timestamp_after = fs::metadata(&storage_path)
.expect("Failed to get metadata")
.modified()
Expand Down

0 comments on commit 5c47dd0

Please sign in to comment.