INNER CODE UNIT · Swift
readMatch
mongodb/mongo-swift-driver · etc/convert-test-results.swift:104
func readMatch(at position: Int, in line: String) throws -> String {
guard let range = Range(self.range(at: position), in: line) else {
throw ParsingError("No capture group match at position \(position)")
}
return String(line[range])
}
}
extension TimeInterval {
init(input: String) throws {
guard let time = TimeInterval(input) else {
throw ParsingError("unable to parse TimeInterval from \(input)")
}
self = time
}
}
func ensureSuiteMatches(old: String, new: String) throws {