@@ -85,6 +85,8 @@ fn simple_tree_with_some_hardlinks() {
8585 . pipe ( InodeNumber :: from)
8686 } ;
8787
88+ let dev = read_device_number ( & workspace) ;
89+
8890 let shared_paths = |suffices : & [ & str ] | {
8991 suffices
9092 . iter ( )
@@ -190,6 +192,7 @@ fn simple_tree_with_some_hardlinks() {
190192 . collect ( ) ;
191193 let expected_shared_details = [
192194 ReflectionEntry {
195+ dev,
193196 ino : file_inode ( "one-internal-hardlink.txt" ) ,
194197 size : file_size ( "one-internal-hardlink.txt" ) ,
195198 links : 1 + 1 ,
@@ -199,6 +202,7 @@ fn simple_tree_with_some_hardlinks() {
199202 ] ) ,
200203 } ,
201204 ReflectionEntry {
205+ dev,
202206 ino : file_inode ( "two-internal-hardlinks.txt" ) ,
203207 size : file_size ( "two-internal-hardlinks.txt" ) ,
204208 links : 1 + 2 ,
@@ -209,12 +213,14 @@ fn simple_tree_with_some_hardlinks() {
209213 ] ) ,
210214 } ,
211215 ReflectionEntry {
216+ dev,
212217 ino : file_inode ( "one-external-hardlink.txt" ) ,
213218 size : file_size ( "one-external-hardlink.txt" ) ,
214219 links : 1 + 1 ,
215220 paths : shared_paths ( & [ "sources/one-external-hardlink.txt" ] ) ,
216221 } ,
217222 ReflectionEntry {
223+ dev,
218224 ino : file_inode ( "one-internal-one-external-hardlinks.txt" ) ,
219225 size : file_size ( "one-internal-one-external-hardlinks.txt" ) ,
220226 links : 1 + 1 + 1 ,
@@ -338,6 +344,8 @@ fn multiple_hardlinks_to_a_single_file() {
338344 . pipe_as_ref ( read_inode_number)
339345 . pipe ( InodeNumber :: from) ;
340346
347+ let dev = read_device_number ( & workspace) ;
348+
341349 let actual_size = tree. size ;
342350 let expected_size = workspace
343351 . pipe_as_ref ( read_apparent_size)
@@ -374,6 +382,7 @@ fn multiple_hardlinks_to_a_single_file() {
374382 . cloned ( )
375383 . collect ( ) ;
376384 let expected_shared_details = [ ReflectionEntry {
385+ dev,
377386 ino : file_inode,
378387 size : file_size,
379388 links : 1 + links,
@@ -470,6 +479,8 @@ fn complex_tree_with_shared_and_unique_files() {
470479 . pipe ( Bytes :: new)
471480 } ;
472481
482+ let dev = read_device_number ( & workspace) ;
483+
473484 let actual_size = tree. size ;
474485
475486 // The following formula treat the first file as "real" and
@@ -562,6 +573,7 @@ fn complex_tree_with_shared_and_unique_files() {
562573 . find ( |item| starts_with_path ( item, "some-hardlinks/file-0.txt" ) )
563574 . cloned ( ) ;
564575 let expected = Some ( ReflectionEntry {
576+ dev,
565577 ino : workspace
566578 . join ( "some-hardlinks/file-0.txt" )
567579 . pipe_as_ref ( read_inode_number)
@@ -591,6 +603,7 @@ fn complex_tree_with_shared_and_unique_files() {
591603 . find ( |item| starts_with_path ( item, & format ! ( "some-hardlinks/file-{file_index}.txt" ) ) )
592604 . cloned ( ) ;
593605 let expected = Some ( ReflectionEntry {
606+ dev,
594607 ino : workspace
595608 . join ( format ! ( "some-hardlinks/file-{file_index}.txt" ) )
596609 . pipe_as_ref ( read_inode_number)
@@ -695,6 +708,8 @@ fn hardlinks_and_non_hardlinks() {
695708 . pipe ( InodeNumber :: from)
696709 } ;
697710
711+ let dev = read_device_number ( & workspace) ;
712+
698713 let shared_paths = |file_names : & [ & str ] | {
699714 file_names
700715 . iter ( )
@@ -717,37 +732,43 @@ fn hardlinks_and_non_hardlinks() {
717732 . collect ( ) ;
718733 let expected_shared_details = [
719734 ReflectionEntry {
735+ dev,
720736 ino : file_inode ( "file-0.txt" ) ,
721737 size : file_size,
722738 links : 3 ,
723739 paths : shared_paths ( & [ "file-0.txt" , "link0-file0.txt" , "link1-file0.txt" ] ) ,
724740 } ,
725741 ReflectionEntry {
742+ dev,
726743 ino : file_inode ( "file-1.txt" ) ,
727744 size : file_size,
728745 links : 2 ,
729746 paths : shared_paths ( & [ "file-1.txt" , "link0-file1.txt" ] ) ,
730747 } ,
731748 // ... file-2.txt and file-3.txt don't have hardlinks so they shouldn't appear here ...
732749 ReflectionEntry {
750+ dev,
733751 ino : file_inode ( "file-4.txt" ) ,
734752 size : file_size,
735753 links : 2 ,
736754 paths : shared_paths ( & [ "file-4.txt" ] ) ,
737755 } ,
738756 ReflectionEntry {
757+ dev,
739758 ino : file_inode ( "file-5.txt" ) ,
740759 size : file_size,
741760 links : 2 ,
742761 paths : shared_paths ( & [ "file-5.txt" ] ) ,
743762 } ,
744763 ReflectionEntry {
764+ dev,
745765 ino : file_inode ( "file-6.txt" ) ,
746766 size : file_size,
747767 links : 2 ,
748768 paths : shared_paths ( & [ "file-6.txt" ] ) ,
749769 } ,
750770 ReflectionEntry {
771+ dev,
751772 ino : file_inode ( "file-7.txt" ) ,
752773 size : file_size,
753774 links : 2 ,
@@ -898,6 +919,8 @@ fn exclusive_hardlinks_only() {
898919 . pipe ( InodeNumber :: from)
899920 } ;
900921
922+ let dev = read_device_number ( & workspace) ;
923+
901924 let shared_paths = |file_names : & [ & str ] | {
902925 file_names
903926 . iter ( )
@@ -921,6 +944,7 @@ fn exclusive_hardlinks_only() {
921944 let expected_shared_details = ( 0 ..files_per_branch)
922945 . par_bridge ( )
923946 . map ( |index| ReflectionEntry {
947+ dev,
924948 ino : file_inode ( & format ! ( "file-{index}.txt" ) ) ,
925949 size : file_size,
926950 links : 2 ,
@@ -1024,6 +1048,8 @@ fn exclusive_only_and_external_only_hardlinks() {
10241048 . pipe ( InodeNumber :: from)
10251049 } ;
10261050
1051+ let dev = read_device_number ( & workspace) ;
1052+
10271053 let shared_paths = |file_names : & [ & str ] | {
10281054 file_names
10291055 . iter ( )
@@ -1050,6 +1076,7 @@ fn exclusive_only_and_external_only_hardlinks() {
10501076 ( 0 ..( files_per_branch / 2 ) )
10511077 . par_bridge ( )
10521078 . map ( |index| ReflectionEntry {
1079+ dev,
10531080 ino : file_inode ( & format ! ( "link0-{index}.txt" ) ) ,
10541081 size : file_size,
10551082 links : 2 ,
@@ -1060,6 +1087,7 @@ fn exclusive_only_and_external_only_hardlinks() {
10601087 ( ( files_per_branch / 2 ) ..files_per_branch)
10611088 . par_bridge ( )
10621089 . map ( |index| ReflectionEntry {
1090+ dev,
10631091 ino : file_inode ( & format ! ( "link0-{index}.txt" ) ) ,
10641092 size : file_size,
10651093 links : 2 ,
@@ -1187,6 +1215,8 @@ fn external_hardlinks_only() {
11871215 . pipe ( InodeNumber :: from)
11881216 } ;
11891217
1218+ let dev = read_device_number ( & workspace) ;
1219+
11901220 let shared_paths = |file_names : & [ & str ] | {
11911221 file_names
11921222 . iter ( )
@@ -1210,6 +1240,7 @@ fn external_hardlinks_only() {
12101240 let expected_shared_details = ( 0 ..files_per_branch)
12111241 . par_bridge ( )
12121242 . map ( |index| ReflectionEntry {
1243+ dev,
12131244 ino : file_inode ( & format ! ( "linkX-{index}.txt" ) ) ,
12141245 size : file_size,
12151246 links : 2 ,
0 commit comments