@@ -5,6 +5,7 @@ use crate::{
5
5
driver,
6
6
fs:: { Attribute , File , Filesystem } ,
7
7
io:: { Error , OpenSeekFrom , Read , Result , SeekFrom } ,
8
+ path:: PathBuf ,
8
9
} ;
9
10
10
11
ram_storage ! (
@@ -492,13 +493,15 @@ fn test_iter_dirs() {
492
493
tells. push ( dir. tell ( ) ?) ;
493
494
let entry = entry?;
494
495
495
- // assert_eq!(entry.file_name(), match i {
496
- // 0 => b".\0",
497
- // 1 => b"..\0",
498
- // 2 => b"file.a\0",
499
- // 3 => b"file.b\0",
500
- // _ => panic!("oh noes"),
501
- // });
496
+ let expected_name = match i {
497
+ 0 => PathBuf :: from ( b".\0 " . as_slice ( ) ) ,
498
+ 1 => PathBuf :: from ( b"..\0 " . as_slice ( ) ) ,
499
+ 2 => PathBuf :: from ( b"file.a\0 " . as_slice ( ) ) ,
500
+ 3 => PathBuf :: from ( b"file.b\0 " . as_slice ( ) ) ,
501
+ _ => panic ! ( "oh noes" ) ,
502
+ } ;
503
+
504
+ assert_eq ! ( entry. file_name( ) , & * expected_name) ;
502
505
503
506
sizes[ i] = entry. metadata ( ) . len ( ) ;
504
507
found_files += 1 ;
@@ -507,6 +510,7 @@ fn test_iter_dirs() {
507
510
508
511
assert_eq ! ( sizes, [ 0 , 0 , 37 , 42 ] ) ;
509
512
assert_eq ! ( found_files, 4 ) ;
513
+ assert_eq ! ( tells. len( ) , 5 ) ;
510
514
511
515
for ( i, tell) in tells. iter ( ) . enumerate ( ) {
512
516
dir. rewind ( ) . unwrap ( ) ;
0 commit comments