Skip to content

Commit 7399471

Browse files
committed
add shallow_find_files helper to run_make_support
1 parent 3cdce7e commit 7399471

File tree

2 files changed

+285
-167
lines changed
  • src/tools/run-make-support/src
  • tests/run-make/output-type-permutations

2 files changed

+285
-167
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,11 @@ pub fn not_contains<P: AsRef<Path>>(path: P, expected: &str) -> bool {
295295
!path.as_ref().file_name().is_some_and(|name| name.to_str().unwrap().contains(expected))
296296
}
297297

298+
/// Returns true if the filename at `path` is not in `expected`.
299+
pub fn name_not_among<P: AsRef<Path>>(path: P, expected: &[&'static str]) -> bool {
300+
path.as_ref().file_name().is_some_and(|name| !expected.contains(&name.to_str().unwrap()))
301+
}
302+
298303
/// Use `cygpath -w` on a path to get a Windows path string back. This assumes that `cygpath` is
299304
/// available on the platform!
300305
#[track_caller]

0 commit comments

Comments
 (0)