1 package kotlinx.coroutines.rx3 2 3 import kotlinx.coroutines.testing.* 4 import io.reactivex.rxjava3.core.* 5 import kotlinx.coroutines.* 6 import kotlinx.coroutines.flow.* 7 import kotlinx.coroutines.reactive.* 8 import org.junit.Test 9 import kotlin.test.* 10 11 class BackpressureTest : TestBase() { 12 @Test <lambda>null13 fun testBackpressureDropDirect() = runTest { 14 expect(1) 15 Flowable.fromArray(1) 16 .onBackpressureDrop() 17 .collect { 18 assertEquals(1, it) 19 expect(2) 20 } 21 finish(3) 22 } 23 24 @Test <lambda>null25 fun testBackpressureDropFlow() = runTest { 26 expect(1) 27 Flowable.fromArray(1) 28 .onBackpressureDrop() 29 .asFlow() 30 .collect { 31 assertEquals(1, it) 32 expect(2) 33 } 34 finish(3) 35 } 36 } 37