We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 056a68d commit 32a354eCopy full SHA for 32a354e
tests/run-pass/fs.rs
@@ -169,8 +169,16 @@ fn test_rename() {
169
170
let file = File::create(&path1).unwrap();
171
drop(file);
172
+
173
+ // Renaming should succeed
174
rename(&path1, &path2).unwrap();
175
+ // Check that the old file path isn't present
176
assert_eq!(ErrorKind::NotFound, path1.metadata().unwrap_err().kind());
177
+ // Check that the file has moved successfully
178
assert!(path2.metadata().unwrap().is_file());
179
180
+ // Renaming a nonexistent file should fail
181
+ assert_eq!(ErrorKind::NotFound, rename(&path1, &path2).unwrap_err().kind());
182
183
remove_file(&path2).unwrap();
184
}
0 commit comments