@@ -17,10 +17,7 @@ const files: Array<FileDescriptor> = [
1717 mode : 16877 ,
1818 isDir : true ,
1919 readonly : false ,
20- id : {
21- ino : 0n ,
22- dev : 1n ,
23- } ,
20+ id : '0-1' ,
2421 isSym : false ,
2522 target : '' ,
2623 type : '' ,
@@ -37,10 +34,7 @@ const files: Array<FileDescriptor> = [
3734 mode : 33188 ,
3835 isDir : false ,
3936 readonly : false ,
40- id : {
41- ino : 1n ,
42- dev : 1n ,
43- } ,
37+ id : '1-1' ,
4438 isSym : false ,
4539 target : '' ,
4640 type : '' ,
@@ -57,10 +51,7 @@ const files: Array<FileDescriptor> = [
5751 mode : 33188 ,
5852 isDir : false ,
5953 readonly : false ,
60- id : {
61- ino : 2n ,
62- dev : 1n ,
63- } ,
54+ id : '2-1' ,
6455 isSym : false ,
6556 target : '' ,
6657 type : '' ,
@@ -77,10 +68,7 @@ const files: Array<FileDescriptor> = [
7768 mode : 33188 ,
7869 isDir : false ,
7970 readonly : false ,
80- id : {
81- ino : 3n ,
82- dev : 1n ,
83- } ,
71+ id : '3-1' ,
8472 isSym : false ,
8573 target : '' ,
8674 type : '' ,
@@ -90,25 +78,25 @@ const files: Array<FileDescriptor> = [
9078describe ( 'sorting methods' , ( ) => {
9179 it ( 'sort by Name/Asc' , ( ) => {
9280 const sortMethod = getSortMethod ( 'name' , 'asc' )
93- const sorted_ids = files . sort ( sortMethod ) . map ( ( file ) => file . id . ino )
94- expect ( sorted_ids ) . toEqual ( [ 2n , 0n , 1n , 3n ] )
81+ const sorted_ids = files . sort ( sortMethod ) . map ( ( file ) => file . id )
82+ expect ( sorted_ids ) . toEqual ( [ '2-1' , '0-1' , '1-1' , '3-1' ] )
9583 } )
9684
9785 it ( 'sort by Name/Desc' , ( ) => {
9886 const sortMethod = getSortMethod ( 'name' , 'desc' )
99- const sorted_ids = files . sort ( sortMethod ) . map ( ( file ) => file . id . ino )
100- expect ( sorted_ids ) . toEqual ( [ 3n , 1n , 0n , 2n ] )
87+ const sorted_ids = files . sort ( sortMethod ) . map ( ( file ) => file . id )
88+ expect ( sorted_ids ) . toEqual ( [ '3-1' , '1-1' , '0-1' , '2-1' ] )
10189 } )
10290
10391 it ( 'sort by Size/Asc' , ( ) => {
10492 const sortMethod = getSortMethod ( 'size' , 'asc' )
105- const sorted_ids = files . sort ( sortMethod ) . map ( ( file ) => file . id . ino )
106- expect ( sorted_ids ) . toEqual ( [ 1n , 0n , 3n , 2n ] )
93+ const sorted_ids = files . sort ( sortMethod ) . map ( ( file ) => file . id )
94+ expect ( sorted_ids ) . toEqual ( [ '1-1' , '0-1' , '3-1' , '2-1' ] )
10795 } )
10896
10997 it ( 'sort by Size/Asc' , ( ) => {
11098 const sortMethod = getSortMethod ( 'size' , 'desc' )
111- const sorted_ids = files . sort ( sortMethod ) . map ( ( file ) => file . id . ino )
112- expect ( sorted_ids ) . toEqual ( [ 2n , 3n , 0n , 1n ] )
99+ const sorted_ids = files . sort ( sortMethod ) . map ( ( file ) => file . id )
100+ expect ( sorted_ids ) . toEqual ( [ '2-1' , '3-1' , '0-1' , '1-1' ] )
113101 } )
114102} )
0 commit comments