@@ -11,8 +11,7 @@ import TestingSupport
11
11
12
12
struct TestingTaskGroupTests {
13
13
14
- @Test ( " Given tasks are scheduled at the same time, Then all the tasks are executed in order of enqueueing " )
15
- func executeTasksInOrderOfEnqueueing( ) async throws {
14
+ @Test func `Given tasks are scheduled at the same time, Then all the tasks are executed in order of enqueueing`() async throws {
16
15
let ( stream, continuation) = AsyncStream . makeStream ( of: Int . self)
17
16
let operations = 0 ..< 100
18
17
@@ -29,8 +28,7 @@ struct TestingTaskGroupTests {
29
28
await #expect( stream. collect( ) == Array( operations) )
30
29
}
31
30
32
- @Test ( " Given tasks are scheduled at different times, Then all the tasks are executed in order of scheduling " )
33
- func executeTasksInOrderOfScheduling( ) async throws {
31
+ @Test func `Given tasks are scheduled at different times, Then all the tasks are executed in order of scheduling`() async throws {
34
32
let ( stream, continuation) = AsyncStream . makeStream ( of: Int . self)
35
33
let source = 0 ..< 100
36
34
@@ -47,8 +45,7 @@ struct TestingTaskGroupTests {
47
45
await #expect( stream. collect ( ) == Array ( source) )
48
46
}
49
47
50
- @Test ( " Given tasks with large time gaps, Then all the tasks are executed in order of scheduling " )
51
- func executeTasksWithLargeTimeGaps( ) async throws {
48
+ @Test func `Given tasks with large time gaps, Then all the tasks are executed in order of scheduling`() async throws {
52
49
let ( stream, continuation) = AsyncStream . makeStream ( of: Int . self)
53
50
54
51
_ = try await withTestingTaskGroup ( observing: Void . self) { group in
@@ -68,8 +65,7 @@ struct TestingTaskGroupTests {
68
65
await #expect( stream. collect ( ) == [ 1 , 2 , 3 ] )
69
66
}
70
67
71
- @Test ( " Given task suspended by dependency, When another task resolves dependency, Then dependent task resumes its work " )
72
- func resumeDependentTaskWhenDependencyIsResolved( ) async throws {
68
+ @Test func `Given task suspended by dependency, When another task resolves dependency, Then dependent task resumes its work`() async throws {
73
69
let order = AsyncStream . makeStream ( of: Int . self)
74
70
let dependency = AsyncStream . makeStream ( of: Void . self)
75
71
@@ -92,8 +88,7 @@ struct TestingTaskGroupTests {
92
88
await #expect( order. stream. collect ( ) == [ 0 , 1 , 2 , 3 ] )
93
89
}
94
90
95
- @Test ( " Given task suspended by long running dependency, When group exceeds provided timeout, Then group is cancelled and throws timeout error " )
96
- func cancelTaskGroupWhenProvidedTimeoutIsExceeded( ) async throws {
91
+ @Test func `Given task suspended by long running dependency, When group exceeds provided timeout, Then group is cancelled and throws timeout error`() async throws {
97
92
await #expect( throws: TimeoutError . self) {
98
93
_ = try await withTestingTaskGroup ( observing: Void . self, timeout: 1 ) { group in
99
94
group. addTask ( at: 0 ) {
@@ -118,8 +113,7 @@ struct TestingTaskGroupTests {
118
113
}
119
114
}
120
115
121
- @Test ( " Given observed sequence is finite, When sequence completes, Then observation finishes " )
122
- func observationFinishes( ) async throws {
116
+ @Test func `Given observed sequence is finite, When sequence complet es , Then observation finishes`() async throws {
123
117
let ( stream, continuation) = AsyncStream . makeStream ( of: Int . self)
124
118
125
119
let result = try await withTestingTaskGroup { group in
@@ -144,8 +138,7 @@ struct TestingTaskGroupTests {
144
138
] )
145
139
}
146
140
147
- @Test ( " Given observed sequence is infinite, When all tasks complete, Then observation finishes " )
148
- func infiniteObservationFinishes( ) async throws {
141
+ @Test func `Given observed sequence is infinite, When all tasks complet e , Then observation finishes`() async throws {
149
142
let ( stream, continuation) = AsyncStream . makeStream ( of: Int . self)
150
143
151
144
let result = try await withTestingTaskGroup { group in
0 commit comments