Skip to content

Commit 542b0e3

Browse files
authored
Merge pull request #146 from milseman/noescape_by_default
[noescape by default] Add explicit @escaping for escaping closures
2 parents 1f00ab2 + 770624c commit 542b0e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/XCTest/Public/XCTestCase.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public class XCTestCase: XCTest {
8989
/// - Note: Like the designated initializer for Apple XCTest's XCTestCase,
9090
/// `-[XCTestCase initWithInvocation:]`, it's rare for anyone outside of
9191
/// XCTest itself to call this initializer.
92-
public required init(name: String, testClosure: (XCTestCase) throws -> Void) {
92+
public required init(name: String, testClosure: @escaping (XCTestCase) throws -> Void) {
9393
_name = "\(self.dynamicType).\(name)"
9494
self.testClosure = testClosure
9595
}
@@ -176,7 +176,7 @@ public func testCase<T: XCTestCase>(_ allTests: [(String, (T) -> () -> Void)]) -
176176
return (T.self, tests)
177177
}
178178

179-
private func test<T: XCTestCase>(_ testFunc: (T) -> () throws -> Void) -> (XCTestCase) throws -> Void {
179+
private func test<T: XCTestCase>(_ testFunc: @escaping (T) -> () throws -> Void) -> (XCTestCase) throws -> Void {
180180
return { testCaseType in
181181
guard let testCase = testCaseType as? T else {
182182
fatalError("Attempt to invoke test on class \(T.self) with incompatible instance type \(testCaseType.dynamicType)")

0 commit comments

Comments
 (0)