From 8647e29159246a1616f643ad8128ac92299a9743 Mon Sep 17 00:00:00 2001
From: Alex Macleod <alex@macleod.io>
Date: Tue, 27 Jun 2023 20:36:05 +0000
Subject: [PATCH] Use substring matching for TESTNAME

---
 tests/compile-test.rs | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/tests/compile-test.rs b/tests/compile-test.rs
index 745faaddda6..08d41adf9e7 100644
--- a/tests/compile-test.rs
+++ b/tests/compile-test.rs
@@ -64,12 +64,7 @@ fn base_config(test_dir: &str) -> compiletest::Config {
 fn test_filter() -> Box<dyn Sync + Fn(&Path) -> bool> {
     if let Ok(filters) = env::var("TESTNAME") {
         let filters: Vec<_> = filters.split(',').map(ToString::to_string).collect();
-        Box::new(move |path| {
-            filters.is_empty()
-                || filters
-                    .iter()
-                    .any(|f| path.file_stem().map_or(false, |stem| stem == f.as_str()))
-        })
+        Box::new(move |path| filters.iter().any(|f| path.to_string_lossy().contains(f)))
     } else {
         Box::new(|_| true)
     }