File tree Expand file tree Collapse file tree 3 files changed +11
-33
lines changed
Sources/ComposableArchitecture
Tests/ComposableArchitectureTests Expand file tree Collapse file tree 3 files changed +11
-33
lines changed Original file line number Diff line number Diff line change 1
1
PLATFORM_IOS = iOS Simulator,name=iPhone 11 Pro Max
2
2
PLATFORM_MACOS = macOS
3
3
PLATFORM_TVOS = tvOS Simulator,name=Apple TV
4
- PLATFORM_WATCHOS = watchOS Simulator,name=Apple Watch Series 5 - 44mm
4
+ PLATFORM_WATCHOS = watchOS Simulator,name=Apple Watch Series 7 (45mm)
5
+
5
6
default : test-all
6
7
7
8
test-all : test-library test-examples
@@ -34,27 +35,11 @@ test-docs:
34
35
&& exit 1)
35
36
36
37
test-examples :
37
- xcodebuild test \
38
- -scheme " CaseStudies (SwiftUI)" \
39
- -destination platform=" $( PLATFORM_IOS) "
40
- xcodebuild test \
41
- -scheme " CaseStudies (UIKit)" \
42
- -destination platform=" $( PLATFORM_IOS) "
43
- xcodebuild test \
44
- -scheme Search \
45
- -destination platform=" $( PLATFORM_IOS) "
46
- xcodebuild test \
47
- -scheme SpeechRecognition \
48
- -destination platform=" $( PLATFORM_IOS) "
49
- xcodebuild test \
50
- -scheme TicTacToe \
51
- -destination platform=" $( PLATFORM_IOS) "
52
- xcodebuild test \
53
- -scheme Todos \
54
- -destination platform=" $( PLATFORM_IOS) "
55
- xcodebuild test \
56
- -scheme VoiceMemos \
57
- -destination platform=" $( PLATFORM_IOS) "
38
+ for scheme in " CaseStudies (SwiftUI)" " CaseStudies (UIKit)" Search SpeechRecognition TicTacToe Todos VoiceMemos; do \
39
+ xcodebuild test \
40
+ -scheme $$ scheme \
41
+ -destination platform=" $( PLATFORM_IOS) " ; \
42
+ done
58
43
59
44
benchmark :
60
45
swift run --configuration release \
Original file line number Diff line number Diff line change @@ -487,7 +487,6 @@ private struct HashableWrapper<Value>: Hashable {
487
487
public func yield( while predicate: @escaping ( State ) -> Bool ) async {
488
488
let cancellable = Box < Disposable ? > ( wrappedValue: nil )
489
489
try ? await withTaskCancellationHandler (
490
- handler: { cancellable. wrappedValue? . dispose ( ) } ,
491
490
operation: {
492
491
try Task . checkCancellation ( )
493
492
try await withUnsafeThrowingContinuation {
@@ -504,9 +503,9 @@ private struct HashableWrapper<Value>: Hashable {
504
503
_ = cancellable
505
504
}
506
505
}
507
- }
506
+ } ,
507
+ onCancel: { cancellable. wrappedValue? . dispose ( ) }
508
508
)
509
-
510
509
}
511
510
}
512
511
Original file line number Diff line number Diff line change @@ -172,8 +172,7 @@ final class ViewStoreTests: XCTestCase {
172
172
}
173
173
174
174
#if canImport(_Concurrency) && compiler(>=5.5.2)
175
- func testSendWhile( ) {
176
- let expectation = self . expectation ( description: " await " )
175
+ func testSendWhile( ) async {
177
176
Task { @MainActor in
178
177
enum Action {
179
178
case response
@@ -197,13 +196,10 @@ final class ViewStoreTests: XCTestCase {
197
196
XCTAssertNoDifference ( viewStore. state, false )
198
197
await viewStore. send ( . tapped, while: { $0 } )
199
198
XCTAssertNoDifference ( viewStore. state, false )
200
- expectation. fulfill ( )
201
199
}
202
- self . wait ( for: [ expectation] , timeout: 1 )
203
200
}
204
201
205
- func testSuspend( ) {
206
- let expectation = self . expectation ( description: " await " )
202
+ func testSuspend( ) async {
207
203
Task { @MainActor in
208
204
enum Action {
209
205
case response
@@ -229,9 +225,7 @@ final class ViewStoreTests: XCTestCase {
229
225
XCTAssertNoDifference ( viewStore. state, true )
230
226
await viewStore. yield ( while: { $0 } )
231
227
XCTAssertNoDifference ( viewStore. state, false )
232
- expectation. fulfill ( )
233
228
}
234
- self . wait ( for: [ expectation] , timeout: 1 )
235
229
}
236
230
#endif
237
231
}
You can’t perform that action at this time.
0 commit comments