INNER CODE UNIT · Swift
processSuiteDetails
mongodb/mongo-swift-driver · etc/convert-test-results.swift:215
mutating func processSuiteDetails(line: String, regexResult: NSTextCheckingResult) throws {
guard case .awaitingSuiteDetails(let prevName, let completeTests, var completeSuites) = self else {
return
}
let countStr = try regexResult.readMatch(at: 1, in: line)
guard let count = Int(countStr) else {
throw ParsingError("failed to parse integer from string \(countStr)")
}
guard count == completeTests.count else {
throw ParsingError("Suite has \(count) tests, but only \(completeTests.count) were found from output")
}
let failuresStr = try regexResult.readMatch(at: 2, in: line)
guard let failures = Int(failuresStr) else {
throw ParsingError("failed to parse integer from string \(failuresStr)")
}