From d027bbb77022d257f543683b43124360aafcfb0b Mon Sep 17 00:00:00 2001 From: Daniel Strokis Date: Tue, 29 Mar 2022 09:23:23 -0700 Subject: [PATCH] Remove unneeded print statements (#101) * Change CoverageAction to write to given log handle * Remove extraneous print statements from tests rdar://87784021 --- .../SwiftDocCUtilities/Action/Actions/CoverageAction.swift | 5 +++-- .../ConvertService/ConvertServiceTests.swift | 5 ----- Tests/SwiftDocCTests/Model/DocumentationMarkupTests.swift | 1 - 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Sources/SwiftDocCUtilities/Action/Actions/CoverageAction.swift b/Sources/SwiftDocCUtilities/Action/Actions/CoverageAction.swift index c65499e21d..81d64620c9 100644 --- a/Sources/SwiftDocCUtilities/Action/Actions/CoverageAction.swift +++ b/Sources/SwiftDocCUtilities/Action/Actions/CoverageAction.swift @@ -29,7 +29,8 @@ public struct CoverageAction: Action { public mutating func perform(logHandle: LogHandle) throws -> ActionResult { switch documentationCoverageOptions.level { case .brief, .detailed: - Swift.print(" --- Experimental coverage output enabled. ---") + var logHandle = logHandle + print(" --- Experimental coverage output enabled. ---", to: &logHandle) let summaryString = try CoverageDataEntry.generateSummary( ofDataAt: workingDirectory.appendingPathComponent( @@ -38,7 +39,7 @@ public struct CoverageAction: Action { shouldGenerateBrief: true, shouldGenerateDetailed: (documentationCoverageOptions.level == .detailed) ) - print(summaryString) + print(summaryString, to: &logHandle) case .none: break } diff --git a/Tests/SwiftDocCTests/DocumentationService/ConvertService/ConvertServiceTests.swift b/Tests/SwiftDocCTests/DocumentationService/ConvertService/ConvertServiceTests.swift index 41de203afc..87808e3568 100644 --- a/Tests/SwiftDocCTests/DocumentationService/ConvertService/ConvertServiceTests.swift +++ b/Tests/SwiftDocCTests/DocumentationService/ConvertService/ConvertServiceTests.swift @@ -835,11 +835,6 @@ class ConvertServiceTests: XCTestCase { assert: { renderNodes, referenceStore in let referenceStore = try XCTUnwrap(referenceStore) let paths = Set(referenceStore.topics.keys.map(\.path)) - - Set(referenceStore.topics.keys.map(\.path)).forEach { s in - print("path: \(s)") - } - XCTAssertTrue(paths.contains("/documentation/SideKit/SideClass/Element")) XCTAssertFalse(paths.contains("/documentation/SideKit/SideClass/Element/Protocol-Implementations")) } diff --git a/Tests/SwiftDocCTests/Model/DocumentationMarkupTests.swift b/Tests/SwiftDocCTests/Model/DocumentationMarkupTests.swift index bbe712ee1e..a68e85ebba 100644 --- a/Tests/SwiftDocCTests/Model/DocumentationMarkupTests.swift +++ b/Tests/SwiftDocCTests/Model/DocumentationMarkupTests.swift @@ -155,7 +155,6 @@ class DocumentationMarkupTests: XCTestCase { Text " Abstract." """ let model = DocumentationMarkup(markup: Document(parsing: source, options: .parseBlockDirectives)) - print(model.abstractSection!.content.map({ $0.detachedFromParent.debugDescription() }).joined(separator: "\n")) XCTAssertEqual(expected, model.abstractSection?.content.map({ $0.detachedFromParent.debugDescription() }).joined(separator: "\n")) }