@@ -3,21 +3,22 @@ use crate::size::Bytes;
33use pipe_trait:: Pipe ;
44use pretty_assertions:: { assert_eq, assert_ne} ;
55
6- const TABLE : & [ ( u64 , u64 , u64 , & str ) ] = & [
7- ( 241 , 3652 , 1 , "a" ) ,
8- ( 569 , 2210 , 1 , "b" ) ,
9- ( 110 , 2350 , 3 , "c" ) ,
10- ( 110 , 2350 , 3 , "c1" ) ,
11- ( 778 , 1110 , 1 , "d" ) ,
12- ( 274 , 6060 , 2 , "e" ) ,
13- ( 274 , 6060 , 2 , "e1" ) ,
14- ( 883 , 4530 , 1 , "f" ) ,
6+ const TABLE : & [ ( u64 , u64 , u64 , u64 , & str ) ] = & [
7+ // dev, ino, size, links, path
8+ ( 0 , 241 , 3652 , 1 , "a" ) ,
9+ ( 0 , 569 , 2210 , 1 , "b" ) ,
10+ ( 0 , 110 , 2350 , 3 , "c" ) ,
11+ ( 0 , 110 , 2350 , 3 , "c1" ) ,
12+ ( 0 , 778 , 1110 , 1 , "d" ) ,
13+ ( 0 , 274 , 6060 , 2 , "e" ) ,
14+ ( 0 , 274 , 6060 , 2 , "e1" ) ,
15+ ( 0 , 883 , 4530 , 1 , "f" ) ,
1516] ;
1617
1718fn add < const ROW : usize > ( list : HardlinkList < Bytes > ) -> HardlinkList < Bytes > {
1819 let values = TABLE [ ROW ] ;
19- let ( ino, size, links, path) = values;
20- if let Err ( error) = list. add ( ino. into ( ) , size. into ( ) , links, path. as_ref ( ) ) {
20+ let ( dev , ino, size, links, path) = values;
21+ if let Err ( error) = list. add ( ino. into ( ) , dev , size. into ( ) , links, path. as_ref ( ) ) {
2122 panic ! ( "Failed to add {values:?} (index: {ROW}) to the list: {error}" ) ;
2223 }
2324 list
@@ -119,10 +120,10 @@ fn insertion_difference_cause_inequality() {
119120#[ test]
120121fn detect_size_change ( ) {
121122 let list = HardlinkList :: < Bytes > :: new ( ) ;
122- list. add ( 123 . into ( ) , 100 . into ( ) , 1 , "a" . as_ref ( ) )
123+ list. add ( 123 . into ( ) , 0 , 100 . into ( ) , 1 , "a" . as_ref ( ) )
123124 . expect ( "add the first path" ) ;
124125 let actual = list
125- . add ( 123 . into ( ) , 110 . into ( ) , 1 , "b" . as_ref ( ) )
126+ . add ( 123 . into ( ) , 0 , 110 . into ( ) , 1 , "b" . as_ref ( ) )
126127 . expect_err ( "add the second path" ) ;
127128 let expected = AddError :: SizeConflict ( SizeConflictError {
128129 ino : 123 . into ( ) ,
@@ -135,10 +136,10 @@ fn detect_size_change() {
135136#[ test]
136137fn detect_number_of_links_change ( ) {
137138 let list = HardlinkList :: < Bytes > :: new ( ) ;
138- list. add ( 123 . into ( ) , 100 . into ( ) , 1 , "a" . as_ref ( ) )
139+ list. add ( 123 . into ( ) , 0 , 100 . into ( ) , 1 , "a" . as_ref ( ) )
139140 . expect ( "add the first path" ) ;
140141 let actual = list
141- . add ( 123 . into ( ) , 100 . into ( ) , 2 , "b" . as_ref ( ) )
142+ . add ( 123 . into ( ) , 0 , 100 . into ( ) , 2 , "b" . as_ref ( ) )
142143 . expect_err ( "add the second path" ) ;
143144 let expected = AddError :: NumberOfLinksConflict ( NumberOfLinksConflictError {
144145 ino : 123 . into ( ) ,
0 commit comments