unlock test: async_taskgroup_asynciterator_semantics

This commit is contained in:
Konrad `ktoso` Malawski
2023-08-08 20:27:43 +09:00
parent 383c62f731
commit 376a9a80c3

View File

@@ -6,8 +6,6 @@
// UNSUPPORTED: back_deployment_runtime
// UNSUPPORTED: OS=linux-gnu
// REQUIRES: rdar86028226
struct Boom: Error {}
func boom() async throws -> Int {
@@ -18,7 +16,7 @@ func boom() async throws -> Int {
func test_taskGroup_next() async {
let sum = await withThrowingTaskGroup(of: Int.self, returning: Int.self) { group in
for n in 1...10 {
group.spawn {
group.addTask {
return n.isMultiple(of: 3) ? try await boom() : n
}
}
@@ -51,7 +49,7 @@ func test_taskGroup_next() async {
func test_taskGroup_for_in() async {
let sum = await withThrowingTaskGroup(of: Int.self, returning: Int.self) { group in
for n in 1...10 {
group.spawn {
group.addTask {
return n.isMultiple(of: 3) ? try await boom() : n
}
}
@@ -82,7 +80,7 @@ func test_taskGroup_for_in() async {
func test_taskGroup_asyncIterator() async {
let sum = await withThrowingTaskGroup(of: Int.self, returning: Int.self) { group in
for n in 1...10 {
group.spawn {
group.addTask {
return n.isMultiple(of: 3) ? try await boom() : n
}
}
@@ -120,7 +118,7 @@ func test_taskGroup_asyncIterator() async {
func test_taskGroup_contains() async {
let sum = await withTaskGroup(of: Int.self, returning: Int.self) { group in
for n in 1...4 {
group.spawn {
group.addTask {
return n
}
}
@@ -129,7 +127,7 @@ func test_taskGroup_contains() async {
print("three = \(three)") // CHECK: three = true
for n in 5...7 {
group.spawn {
group.addTask {
return n
}
}