@@ -78,7 +78,7 @@ pub use fs_helpers::{copy_dir_all, create_symlink, read_dir};
78
78
pub use scoped_run:: { run_in_tmpdir, test_while_readonly} ;
79
79
80
80
pub use assertion_helpers:: {
81
- assert_contains, assert_equals, assert_not_contains,
81
+ assert_contains, assert_equals, assert_not_contains, assert_recursive_eq ,
82
82
count_regex_matches_in_files_with_extension, filename_not_in_denylist, has_extension,
83
83
has_prefix, has_suffix, invalid_utf8_contains, invalid_utf8_not_contains, not_contains,
84
84
shallow_find_files,
@@ -116,28 +116,3 @@ pub fn set_host_rpath(cmd: &mut Command) {
116
116
std:: env:: join_paths ( paths. iter ( ) ) . unwrap ( )
117
117
} ) ;
118
118
}
119
-
120
- /// Assert that all files in `dir1` exist and have the same content in `dir2`
121
- pub fn assert_recursive_eq ( dir1 : impl AsRef < Path > , dir2 : impl AsRef < Path > ) {
122
- let dir2 = dir2. as_ref ( ) ;
123
- read_dir ( dir1, |entry_path| {
124
- let entry_name = entry_path. file_name ( ) . unwrap ( ) ;
125
- if entry_path. is_dir ( ) {
126
- assert_recursive_eq ( & entry_path, & dir2. join ( entry_name) ) ;
127
- } else {
128
- let path2 = dir2. join ( entry_name) ;
129
- let file1 = fs_wrapper:: read ( & entry_path) ;
130
- let file2 = fs_wrapper:: read ( & path2) ;
131
-
132
- // We don't use `assert_eq!` because they are `Vec<u8>`, so not great for display.
133
- // Why not using String? Because there might be minified files or even potentially
134
- // binary ones, so that would display useless output.
135
- assert ! (
136
- file1 == file2,
137
- "`{}` and `{}` have different content" ,
138
- entry_path. display( ) ,
139
- path2. display( ) ,
140
- ) ;
141
- }
142
- } ) ;
143
- }
0 commit comments