File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed
Sources/ComposableArchitecture
Tests/ComposableArchitectureTests Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -1895,7 +1895,7 @@ extension TestStore {
1895
1895
)
1896
1896
1897
1897
for effect in self . reducer. inFlightEffects {
1898
- _ = Effect < Never , Never > . cancel ( id: effect. id) . producer. startWithValues { _ in }
1898
+ _ = Effect < Never , Never > . cancel ( id: effect. id) . producer. startWithCompleted { }
1899
1899
}
1900
1900
self . reducer. inFlightEffects = [ ]
1901
1901
}
@@ -2215,7 +2215,8 @@ private func _XCTExpectFailure(
2215
2215
strict: Bool = true ,
2216
2216
failingBlock: ( ) -> Void
2217
2217
) {
2218
- #if DEBUG
2218
+ // Obj-C runtime functions not supported on Linux, e.g. `NSSelectorFromString`
2219
+ #if DEBUG && !os(Linux)
2219
2220
guard
2220
2221
let XCTExpectedFailureOptions = NSClassFromString ( " XCTExpectedFailureOptions " )
2221
2222
as Any as? NSObjectProtocol ,
Original file line number Diff line number Diff line change 1
- #if DEBUG
1
+
2
+ // `@MainActor` introduces issues gathering tests on Linux
3
+ #if DEBUG && !os(Linux)
2
4
import ComposableArchitecture
5
+ import ReactiveSwift
3
6
import XCTest
4
7
5
8
@MainActor
493
496
}
494
497
495
498
func testPartialExhaustivityPrefix( ) async {
496
- let testScheduler = DispatchQueue . test
499
+ let testScheduler = TestScheduler ( )
497
500
enum Action {
498
501
case buttonTapped
499
502
case response( Int )
668
671
// This example comes from Krzysztof Zabłocki's blog post:
669
672
// https://www.merowing.info/exhaustive-testing-in-tca/
670
673
func testKrzysztofExample3( ) {
671
- let mainQueue = DispatchQueue . test
674
+ let mainQueue = TestScheduler ( )
672
675
673
676
let store = TestStore (
674
677
initialState: KrzysztofExample . State ( ) ,
675
678
reducer: KrzysztofExample ( )
676
679
)
677
680
store. exhaustivity = . off
678
- store. dependencies. mainQueue = mainQueue. eraseToAnyScheduler ( )
681
+ store. dependencies. mainQueue = mainQueue
679
682
680
683
store. send ( . advanceAgeAndMoodAfterDelay)
681
684
mainQueue. advance ( by: 1 )
770
773
. init( value: . changeAge( state. age + 1 ) ) ,
771
774
. init( value: . changeMood( state. mood + 1 ) )
772
775
)
773
- . delay ( for: 1 , scheduler: self . mainQueue)
774
- . eraseToEffect ( )
776
+ . deferred ( for: 1 , scheduler: self . mainQueue)
775
777
776
778
case let . changeAge( age) :
777
779
state. age = age
You can’t perform that action at this time.
0 commit comments