Skip to content

Commit c3156d7

Browse files
committed
Fix bug in preview test where some diagnostics were written twice
1 parent f189720 commit c3156d7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Tests/SwiftDocCUtilitiesTests/PreviewActionIntegrationTests.swift

+3-5
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,6 @@ class PreviewActionIntegrationTests: XCTestCase {
285285
let workspace = DocumentationWorkspace()
286286
_ = try! DocumentationContext(dataProvider: workspace)
287287

288-
let engine = DiagnosticEngine()
289-
290288
let convertActionTempDirectory = try createTemporaryDirectory()
291289
let createConvertAction = {
292290
try ConvertAction(
@@ -298,8 +296,7 @@ class PreviewActionIntegrationTests: XCTestCase {
298296
emitDigest: false,
299297
currentPlatforms: nil,
300298
fileManager: FileManager.default,
301-
temporaryDirectory: convertActionTempDirectory,
302-
diagnosticEngine: engine)
299+
temporaryDirectory: convertActionTempDirectory)
303300
}
304301

305302
guard let preview = try? PreviewAction(
@@ -308,9 +305,10 @@ class PreviewActionIntegrationTests: XCTestCase {
308305
XCTFail("Could not create preview action from parameters", file: file, line: line)
309306
return
310307
}
311-
312308
// Start watching the source and get the initial (successful) state.
313309
do {
310+
let engine = preview.convertAction.diagnosticEngine
311+
314312
// Wait for watch to produce output.
315313
let logOutputExpectation = expectation(description: "Did produce log output")
316314
let logChecker = OutputChecker(fileURL: pipeURL, expectation: logOutputExpectation) { output in

0 commit comments

Comments
 (0)