You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Enhance xctest_checker such that it substitutes the string "[[@line]]"
and "[[@line+<offset>]]" with the current line number of the source file
when performing checks.
2. Replace all hardcoded and regex line numbers in the functional test
suite with the new substitution.
This allows us to add and remove arbitary lines in the functional test
suite without manually updating line numbers in most cases. Line
offsets will still need to be updated when the distance between the
CHECK and the test failure changes.
self.expectationWithDescription("the first expectation")
17
17
self.expectationWithDescription("the second expectation (the file and line number for this one are included in the failure message")
18
18
}
19
19
20
20
// CHECK: Test Case 'MisuseTestCase.test_whenNoExpectationsAreMade_butTheyAreWaitedFor_fails' started.
21
-
// CHECK: .*/Asynchronous/Misuse/main.swift:24: unexpected error: MisuseTestCase.test_whenNoExpectationsAreMade_butTheyAreWaitedFor_fails : API violation - call made to wait without any expectations having been set.
21
+
// CHECK: .*/Asynchronous/Misuse/main.swift:[[@LINE+3]]: unexpected error: MisuseTestCase.test_whenNoExpectationsAreMade_butTheyAreWaitedFor_fails : API violation - call made to wait without any expectations having been set.
22
22
// CHECK: Test Case 'MisuseTestCase.test_whenNoExpectationsAreMade_butTheyAreWaitedFor_fails' failed \(\d+\.\d+ seconds\).
// CHECK: Test Case 'MisuseTestCase.test_whenExpectationIsFulfilledMultipleTimes_fails' started.
28
-
// CHECK: .*/Asynchronous/Misuse/main.swift:34: unexpected error: MisuseTestCase.test_whenExpectationIsFulfilledMultipleTimes_fails : API violation - multiple calls made to XCTestExpectation.fulfill\(\) for rob.
29
-
// CHECK: .*/Asynchronous/Misuse/main.swift:44: unexpected error: MisuseTestCase.test_whenExpectationIsFulfilledMultipleTimes_fails : API violation - multiple calls made to XCTestExpectation.fulfill\(\) for rob.
28
+
// CHECK: .*/Asynchronous/Misuse/main.swift:[[@LINE+6]]: unexpected error: MisuseTestCase.test_whenExpectationIsFulfilledMultipleTimes_fails : API violation - multiple calls made to XCTestExpectation.fulfill\(\) for rob.
29
+
// CHECK: .*/Asynchronous/Misuse/main.swift:[[@LINE+15]]: unexpected error: MisuseTestCase.test_whenExpectationIsFulfilledMultipleTimes_fails : API violation - multiple calls made to XCTestExpectation.fulfill\(\) for rob.
30
30
// CHECK: Test Case 'MisuseTestCase.test_whenExpectationIsFulfilledMultipleTimes_fails' failed \(\d+\.\d+ seconds\).
0 commit comments