diff --git a/tests/run-pass/clock.rs b/tests/run-pass/clock.rs index 23f45f91ada1..b4c3fa08fdc6 100644 --- a/tests/run-pass/clock.rs +++ b/tests/run-pass/clock.rs @@ -4,5 +4,11 @@ use std::time::SystemTime; fn main() { - let _now = SystemTime::now(); + let now1 = SystemTime::now(); + + // Do some work to make time pass. + for _ in 0..10 { drop(vec![42]); } + + let now2 = SystemTime::now(); + assert!(now2 > now1); } diff --git a/tests/run-pass/fs.rs b/tests/run-pass/fs.rs index f859f934bdd1..0f3512b36605 100644 --- a/tests/run-pass/fs.rs +++ b/tests/run-pass/fs.rs @@ -215,9 +215,13 @@ fn test_directory() { // Clean up the files in the directory remove_file(&path_1).unwrap(); remove_file(&path_2).unwrap(); + // Now there should be nothing left in the directory. + let dir_iter = read_dir(&dir_path).unwrap(); + let file_names = dir_iter.map(|e| e.unwrap().file_name()).collect::>(); + assert!(file_names.is_empty()); // Deleting the directory should succeed. remove_dir(&dir_path).unwrap(); - // Reading the metadata of a non-existent file should fail with a "not found" error. + // Reading the metadata of a non-existent directory should fail with a "not found" error. assert_eq!(ErrorKind::NotFound, check_metadata(&[], &dir_path).unwrap_err().kind()); }