mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Concurrency][Tests] Bump availability in a couple of tests.
Since we've bumped availability elsewhere, we need to bump these tests also.
This commit is contained in:
@@ -203,7 +203,7 @@ await Task.detached { @SomeGlobalActor in
|
||||
// CHECK: Testing a separate task off the main actor
|
||||
print("Testing a separate task off the main actor")
|
||||
await Task.detached {
|
||||
if #available(SwiftStdlib 6.2, *) {
|
||||
if #available(SwiftStdlib 6.3, *) {
|
||||
// Skip tests on platforms that use the same executor for the main
|
||||
// actor and the global concurrent executor.
|
||||
guard Task.defaultExecutor !== MainActor.executor else { return }
|
||||
|
||||
@@ -15,14 +15,14 @@
|
||||
import Dispatch
|
||||
import StdlibUnittest
|
||||
|
||||
@available(SwiftStdlib 6.2, *)
|
||||
@available(SwiftStdlib 6.3, *)
|
||||
actor MyActor {
|
||||
public func doSleep() async {
|
||||
try! await Task.sleep(for: .seconds(0.1))
|
||||
}
|
||||
}
|
||||
|
||||
@available(SwiftStdlib 6.2, *)
|
||||
@available(SwiftStdlib 6.3, *)
|
||||
final class TestExecutor: TaskExecutor, SchedulingExecutor, @unchecked Sendable {
|
||||
var asScheduling: SchedulingExecutor? {
|
||||
return self
|
||||
@@ -58,7 +58,7 @@ final class TestExecutor: TaskExecutor, SchedulingExecutor, @unchecked Sendable
|
||||
}
|
||||
}
|
||||
|
||||
@available(SwiftStdlib 6.2, *)
|
||||
@available(SwiftStdlib 6.3, *)
|
||||
@main struct Main {
|
||||
static func main() async {
|
||||
let tests = TestSuite("sleep_executor")
|
||||
|
||||
Reference in New Issue
Block a user