Skip to content

Commit db010c6

Browse files
committed
Expectations struct for output-type-permutations
1 parent da50aae commit db010c6

File tree

2 files changed

+446
-194
lines changed
  • src/tools/run-make-support/src
  • tests/run-make/output-type-permutations

2 files changed

+446
-194
lines changed

src/tools/run-make-support/src/lib.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -266,14 +266,14 @@ pub fn test_while_readonly<P: AsRef<Path>, F: FnOnce() + std::panic::UnwindSafe>
266266
#[track_caller]
267267
pub fn shallow_find_files<P: AsRef<Path>, F: Fn(&PathBuf) -> bool>(
268268
path: P,
269-
closure: F,
269+
filter: F,
270270
) -> Vec<PathBuf> {
271271
let mut matching_files = Vec::new();
272272
for entry in fs_wrapper::read_dir(path) {
273273
let entry = entry.expect("failed to read directory entry.");
274274
let path = entry.path();
275275

276-
if path.is_file() && closure(&path) {
276+
if path.is_file() && filter(&path) {
277277
matching_files.push(path);
278278
}
279279
}
@@ -291,8 +291,10 @@ pub fn has_extension<P: AsRef<Path>>(path: P, extension: &str) -> bool {
291291
}
292292

293293
/// Returns true if the filename at `path` is not in `expected`.
294-
pub fn name_not_among<P: AsRef<Path>>(path: P, expected: &[&'static str]) -> bool {
295-
path.as_ref().file_name().is_some_and(|name| !expected.contains(&name.to_str().unwrap()))
294+
pub fn filename_not_in_denylist<P: AsRef<Path>>(path: P, expected: &[String]) -> bool {
295+
path.as_ref()
296+
.file_name()
297+
.is_some_and(|name| !expected.contains(&name.to_str().unwrap().to_owned()))
296298
}
297299

298300
/// Use `cygpath -w` on a path to get a Windows path string back. This assumes that `cygpath` is

0 commit comments

Comments
 (0)