File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -418,11 +418,11 @@ class PluginInvocationTests: XCTestCase {
418
418
let diaFileContents = try localFileSystem. readFileContents ( result. diagnosticsFile)
419
419
let diagnosticsSet = try SerializedDiagnostics ( bytes: diaFileContents)
420
420
let hasExpectedDiagnosticsCount = diagnosticsSet. diagnostics. count == 1
421
- let warningDiagnostic = try XCTUnwrap ( diagnosticsSet. diagnostics. first)
422
- let hasExpectedWarningText = warningDiagnostic . text . hasPrefix ( " variable \' unused \' was never used " )
421
+ let warningDiagnosticText = diagnosticsSet. diagnostics. first? . text ?? " "
422
+ let hasExpectedWarningText = warningDiagnosticText . hasPrefix ( " variable \' unused \' was never used " )
423
423
if hasExpectedDiagnosticsCount && hasExpectedWarningText {
424
424
XCTAssertTrue ( hasExpectedDiagnosticsCount, " unexpected diagnostics count in \( diagnosticsSet. diagnostics) from \( result. diagnosticsFile. pathString) " )
425
- XCTAssertTrue ( hasExpectedWarningText, " \( warningDiagnostic ) " )
425
+ XCTAssertTrue ( hasExpectedWarningText, " \( warningDiagnosticText ) " )
426
426
} else {
427
427
print ( " bytes of serialized diagnostics file ` \( result. diagnosticsFile. pathString) `: \( diaFileContents. contents) " )
428
428
try XCTSkipIf ( true , " skipping because of unknown serialized diagnostics issue " )
You can’t perform that action at this time.
0 commit comments