File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -813,6 +813,23 @@ extension DriverTest {
813
813
XCTAssertEqual ( results, [ 1 , - 1 ] )
814
814
}
815
815
816
+ func testAsDriver_throttle2( ) {
817
+ let hotObservable = BackgroundThreadPrimitiveHotObservable < Int > ( )
818
+ let driver = hotObservable. asDriver ( onErrorJustReturn: - 1 ) . throttle ( 0.5 , latest: false )
819
+
820
+ let results = subscribeTwiceOnBackgroundSchedulerAndOnlyOneSubscription ( driver) {
821
+ XCTAssertTrue ( hotObservable. subscriptions == [ SubscribedToHotObservable] )
822
+
823
+ hotObservable. on ( . next( 1 ) )
824
+ hotObservable. on ( . next( 2 ) )
825
+ hotObservable. on ( . error( testError) )
826
+
827
+ XCTAssertTrue ( hotObservable. subscriptions == [ UnsunscribedFromHotObservable] )
828
+ }
829
+
830
+ XCTAssertEqual ( results, [ 1 ] )
831
+ }
832
+
816
833
}
817
834
818
835
// MARK: scan
You can’t perform that action at this time.
0 commit comments