mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
unlock test: async_taskgroup_asynciterator_semantics
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user