INNER CODE UNIT · Swift

ensureSuiteMatches

mongodb/mongo-swift-driver · etc/convert-test-results.swift:121

func ensureSuiteMatches(old: String, new: String) throws {
    guard old == new else {
        throw ParsingError("test suite name \(new) does not match previously found name for current suite \(old)")
    }
}

/// State machine which processes `swift test` output and updates itself accordingly.
enum ParsingState {
    /// In the following cases:
    /// - `completeTests` is stored whenever we are in the middle of a suite, and contains any test cases we have found
    ///   for the suite so far.
    /// - `completeSuites` is always stored and contains all of the suites we have fully parsed so far.

    /// We have read a line indicating that a test suite with the given name started, but we are not in a particular
    /// test case.
    case inSuite(name: String, completeTests: [TestCase], completeSuites: [TestSuite])
    /// We've read a line indicating that a suite with the given name ended, and are expecting to read a next line
    /// containing test pass/fail counts for the suite.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…