File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 44use std:: time:: SystemTime ;
55
66fn main ( ) {
7- let _now = SystemTime :: now ( ) ;
7+ let now1 = SystemTime :: now ( ) ;
8+
9+ // Do some work to make time pass.
10+ for _ in 0 ..10 { drop ( vec ! [ 42 ] ) ; }
11+
12+ let now2 = SystemTime :: now ( ) ;
13+ assert ! ( now2 > now1) ;
814}
Original file line number Diff line number Diff line change @@ -215,9 +215,13 @@ fn test_directory() {
215215 // Clean up the files in the directory
216216 remove_file ( & path_1) . unwrap ( ) ;
217217 remove_file ( & path_2) . unwrap ( ) ;
218+ // Now there should be nothing left in the directory.
219+ let dir_iter = read_dir ( & dir_path) . unwrap ( ) ;
220+ let file_names = dir_iter. map ( |e| e. unwrap ( ) . file_name ( ) ) . collect :: < Vec < _ > > ( ) ;
221+ assert ! ( file_names. is_empty( ) ) ;
218222
219223 // Deleting the directory should succeed.
220224 remove_dir ( & dir_path) . unwrap ( ) ;
221- // Reading the metadata of a non-existent file should fail with a "not found" error.
225+ // Reading the metadata of a non-existent directory should fail with a "not found" error.
222226 assert_eq ! ( ErrorKind :: NotFound , check_metadata( & [ ] , & dir_path) . unwrap_err( ) . kind( ) ) ;
223227}
You can’t perform that action at this time.
0 commit comments