@@ -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,
@@ -136,28 +136,3 @@ pub fn set_host_rpath(cmd: &mut Command) {
136
136
std:: env:: join_paths ( paths. iter ( ) ) . unwrap ( )
137
137
} ) ;
138
138
}
139
-
140
- /// Assert that all files in `dir1` exist and have the same content in `dir2`
141
- pub fn assert_recursive_eq ( dir1 : impl AsRef < Path > , dir2 : impl AsRef < Path > ) {
142
- let dir2 = dir2. as_ref ( ) ;
143
- read_dir ( dir1, |entry_path| {
144
- let entry_name = entry_path. file_name ( ) . unwrap ( ) ;
145
- if entry_path. is_dir ( ) {
146
- assert_recursive_eq ( & entry_path, & dir2. join ( entry_name) ) ;
147
- } else {
148
- let path2 = dir2. join ( entry_name) ;
149
- let file1 = fs_wrapper:: read ( & entry_path) ;
150
- let file2 = fs_wrapper:: read ( & path2) ;
151
-
152
- // We don't use `assert_eq!` because they are `Vec<u8>`, so not great for display.
153
- // Why not using String? Because there might be minified files or even potentially
154
- // binary ones, so that would display useless output.
155
- assert ! (
156
- file1 == file2,
157
- "`{}` and `{}` have different content" ,
158
- entry_path. display( ) ,
159
- path2. display( ) ,
160
- ) ;
161
- }
162
- } ) ;
163
- }
0 commit comments