blob: 6a5e509bbe1c964b46377325951a84d84138cb9f [file] [log] [blame]
package kotlinx.coroutines.experimental.channels
import kotlinx.coroutines.experimental.*
import org.junit.Test
import kotlin.test.*
class ChannelsJvmTest : TestBase() {
@Test
fun testBlocking() {
val ch = Channel<Int>()
val sum = async {
ch.sumBy { it }
}
repeat(10) {
ch.sendBlocking(it)
}
ch.close()
assertEquals(45, runBlocking { sum.await() })
}
}