diff --git a/tests/system.rs b/tests/system.rs index 34e18f763..85ea94c0f 100644 --- a/tests/system.rs +++ b/tests/system.rs @@ -463,8 +463,8 @@ fn run_sccache_command_tests(compiler: Compiler, tempdir: &Path) { Err(e) => panic!("Invalid UTF-8 sequence: {}", e), }; - // Apple clang would match "Apple LLVM version" - let re = Regex::new(r"(?PApple+*)?clang version (?P\d+)").unwrap(); + // Regex to match "Apple LLVM clang version" or "Apple clang version" + let re = Regex::new(r"(?PApple)?.*clang version (?P\d+)").unwrap(); let (major, is_appleclang) = match re.captures(version_output) { Some(c) => ( c.name("major").unwrap().as_str().parse::().unwrap(),