swiftlang / vscode-swift

Visual Studio Code Extension for Swift
https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang
Apache License 2.0
706 stars 47 forks source link

Show diff for failed XCTAssertEqual and XCTAssertIdentical calls #875

Closed plemarquand closed 2 weeks ago

plemarquand commented 3 weeks ago

If a test fails with XCTAssertEqual or XCTAssertIdentical, parse the result to provide a diff by setting the expected and actual values on TestMessage.

If the string representation of the class used for XCTAssertIdentical is identical, the diff would be identical, so don't show the diff view in that case.

Fixes #654

plemarquand commented 3 weeks ago
Screenshot 2024-06-10 at 3 56 10 PM
plemarquand commented 3 weeks ago

@adam-fowler We'll want to add this for Swift Testing but need to wait for it to be included in the JSON interface.

adam-fowler commented 2 weeks ago

@adam-fowler We'll want to add this for Swift Testing but need to wait for it to be included in the JSON interface.

Ok we can treat that separately. I'm happy for this to be merged.