Skip to content

Commit b55f02f

Browse files
authored
Merge pull request swiftlang#414 from stmontgomery/XCTestExpectation-Sendable
Make XCTestExpectation Sendable
2 parents 36d50c0 + 0b92f0e commit b55f02f

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Sources/XCTest/Public/Asynchronous/XCTestExpectation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//
1212

1313
/// Expectations represent specific conditions in asynchronous testing.
14-
open class XCTestExpectation {
14+
open class XCTestExpectation: @unchecked Sendable {
1515

1616
private static var currentMonotonicallyIncreasingToken: UInt64 = 0
1717
private static func queue_nextMonotonicallyIncreasingToken() -> UInt64 {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// RUN: %{swiftc} %s -typecheck -warn-concurrency -warnings-as-errors
2+
3+
#if os(macOS)
4+
import SwiftXCTest
5+
#else
6+
import XCTest
7+
#endif
8+
9+
let expectation = XCTestExpectation()
10+
Task.detached {
11+
expectation.fulfill()
12+
}

0 commit comments

Comments
 (0)