diff --git a/Sources/FileCheck/Pattern.swift b/Sources/FileCheck/Pattern.swift index 963ad20..b1f76c5 100644 --- a/Sources/FileCheck/Pattern.swift +++ b/Sources/FileCheck/Pattern.swift @@ -162,7 +162,11 @@ final class Pattern { patternStr = String(patternStr[patternStr.index(end, offsetBy: 4)...]) // Get the regex name (e.g. "foo"). + #if os(macOS) let nameEnd = matchStr.range(of: ":") + #else + let nameEnd = String(matchStr).range(of: ":") + #endif let name : String if let end = nameEnd?.lowerBound { name = String(matchStr[..