File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,11 @@ fn main() {
19
19
let tmp = std:: env:: temp_dir ( ) ;
20
20
let filename = PathBuf :: from ( "miri_test_fs.txt" ) ;
21
21
let path = tmp. join ( & filename) ;
22
+ let symlink_path = tmp. join ( "miri_test_fs_symlink.txt" ) ;
22
23
let bytes = b"Hello, World!\n " ;
24
+ // Clean the paths for robustness.
25
+ remove_file ( & path) . unwrap_or ( ( ) ) ;
26
+ remove_file ( & symlink_path) . unwrap_or ( ( ) ) ;
23
27
24
28
// Test creating, writing and closing a file (closing is tested when `file` is dropped).
25
29
let mut file = File :: create ( & path) . unwrap ( ) ;
@@ -42,8 +46,7 @@ fn main() {
42
46
std:: env:: set_current_dir ( & tmp) . unwrap ( ) ;
43
47
test_metadata ( bytes, & filename) . unwrap ( ) ;
44
48
45
- // Creating a symbolic link should succeed
46
- let symlink_path = tmp. join ( "miri_test_fs_symlink.txt" ) ;
49
+ // Creating a symbolic link should succeed.
47
50
std:: os:: unix:: fs:: symlink ( & path, & symlink_path) . unwrap ( ) ;
48
51
// Test that the symbolic link has the same contents as the file.
49
52
let mut symlink_file = File :: open ( & symlink_path) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments