Skip to content

Commit d70323d

Browse files
committed
Swap expected and actual assertion values
The values of the error message in the VS Code UI is swapped from how they appear in XCTAssertEqual. Issue: #1441
1 parent 5bb7a2d commit d70323d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/TestExplorer/TestParsers/XCTestOutputParser.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,8 @@ export class XCTestOutputParser implements IXCTestOutputParser {
462462
const match = message.match(regex);
463463
if (match && match[1] !== match[2]) {
464464
return {
465-
expected: match[1],
466-
actual: match[2],
465+
actual: match[1],
466+
expected: match[2],
467467
};
468468
}
469469

test/integration-tests/testexplorer/XCTestOutputParser.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ Test Case '-[MyTests.MyTests testFail]' failed (0.106 seconds).
165165
),
166166
isKnown: false,
167167
diff: {
168-
expected: '"1"',
169-
actual: '"2"',
168+
actual: '"1"',
169+
expected: '"2"',
170170
},
171171
},
172172
],
@@ -485,7 +485,7 @@ Test Suite 'Selected tests' failed at 2024-10-20 22:01:46.306.
485485
});
486486

487487
suite("Diffs", () => {
488-
const testRun = (message: string, expected?: string, actual?: string) => {
488+
const testRun = (message: string, actual?: string, expected?: string) => {
489489
const input = `Test Case '-[MyTests.MyTests testFail]' started.
490490
/Users/user/Developer/MyTests/MyTests.swift:59: error: -[MyTests.MyTests testFail] : ${message}
491491
Test Case '-[MyTests.MyTests testFail]' failed (0.106 seconds).

0 commit comments

Comments
 (0)