diff --git a/tests/system.rs b/tests/system.rs index 2d020e7746..9394c6f574 100644 --- a/tests/system.rs +++ b/tests/system.rs @@ -434,8 +434,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(),