@@ -456,54 +456,54 @@ mod tests {
456456
457457 #[ test]
458458 fn test_file_type_detection ( ) {
459- let tmp = tempdir ( ) . unwrap ( ) ;
459+ let tmp = tempdir ( ) . expect ( "TODO: handle error" ) ;
460460
461461 // Create file
462462 let file_path = tmp. path ( ) . join ( "test.txt" ) ;
463- fs:: write ( & file_path, "content" ) . unwrap ( ) ;
463+ fs:: write ( & file_path, "content" ) . expect ( "TODO: handle error" ) ;
464464
465- let info = FileInfo :: from_path ( & file_path) . unwrap ( ) ;
465+ let info = FileInfo :: from_path ( & file_path) . expect ( "TODO: handle error" ) ;
466466 assert_eq ! ( info. file_type, FileType :: RegularFile ) ;
467467
468468 // Create directory
469469 let dir_path = tmp. path ( ) . join ( "subdir" ) ;
470- fs:: create_dir ( & dir_path) . unwrap ( ) ;
470+ fs:: create_dir ( & dir_path) . expect ( "TODO: handle error" ) ;
471471
472- let info = FileInfo :: from_path ( & dir_path) . unwrap ( ) ;
472+ let info = FileInfo :: from_path ( & dir_path) . expect ( "TODO: handle error" ) ;
473473 assert_eq ! ( info. file_type, FileType :: Directory ) ;
474474 }
475475
476476 #[ test]
477477 fn test_list_directory ( ) {
478- let tmp = tempdir ( ) . unwrap ( ) ;
478+ let tmp = tempdir ( ) . expect ( "TODO: handle error" ) ;
479479
480- fs:: write ( tmp. path ( ) . join ( "a.txt" ) , "" ) . unwrap ( ) ;
481- fs:: write ( tmp. path ( ) . join ( "b.txt" ) , "" ) . unwrap ( ) ;
482- fs:: create_dir ( tmp. path ( ) . join ( "subdir" ) ) . unwrap ( ) ;
480+ fs:: write ( tmp. path ( ) . join ( "a.txt" ) , "" ) . expect ( "TODO: handle error" ) ;
481+ fs:: write ( tmp. path ( ) . join ( "b.txt" ) , "" ) . expect ( "TODO: handle error" ) ;
482+ fs:: create_dir ( tmp. path ( ) . join ( "subdir" ) ) . expect ( "TODO: handle error" ) ;
483483
484- let entries = list_directory ( tmp. path ( ) ) . unwrap ( ) ;
484+ let entries = list_directory ( tmp. path ( ) ) . expect ( "TODO: handle error" ) ;
485485 assert_eq ! ( entries. len( ) , 3 ) ;
486486 }
487487
488488 #[ test]
489489 fn test_atomic_write ( ) {
490- let tmp = tempdir ( ) . unwrap ( ) ;
490+ let tmp = tempdir ( ) . expect ( "TODO: handle error" ) ;
491491 let path = tmp. path ( ) . join ( "atomic.txt" ) ;
492492
493- atomic_write ( & path, b"test content" ) . unwrap ( ) ;
493+ atomic_write ( & path, b"test content" ) . expect ( "TODO: handle error" ) ;
494494
495495 assert ! ( path. exists( ) ) ;
496- assert_eq ! ( fs:: read_to_string( & path) . unwrap ( ) , "test content" ) ;
496+ assert_eq ! ( fs:: read_to_string( & path) . expect ( "TODO: handle error" ) , "test content" ) ;
497497 }
498498
499499 #[ test]
500500 fn test_directory_size ( ) {
501- let tmp = tempdir ( ) . unwrap ( ) ;
501+ let tmp = tempdir ( ) . expect ( "TODO: handle error" ) ;
502502
503- fs:: write ( tmp. path ( ) . join ( "a.txt" ) , "12345" ) . unwrap ( ) ;
504- fs:: write ( tmp. path ( ) . join ( "b.txt" ) , "123" ) . unwrap ( ) ;
503+ fs:: write ( tmp. path ( ) . join ( "a.txt" ) , "12345" ) . expect ( "TODO: handle error" ) ;
504+ fs:: write ( tmp. path ( ) . join ( "b.txt" ) , "123" ) . expect ( "TODO: handle error" ) ;
505505
506- let size = directory_size ( tmp. path ( ) ) . unwrap ( ) ;
506+ let size = directory_size ( tmp. path ( ) ) . expect ( "TODO: handle error" ) ;
507507 assert_eq ! ( size, 8 ) ;
508508 }
509509}
0 commit comments