aboutsummaryrefslogtreecommitdiffstats
path: root/kotlinx-coroutines-core/common/test/channels/ProduceTest.kt
diff options
context:
space:
mode:
Diffstat (limited to 'kotlinx-coroutines-core/common/test/channels/ProduceTest.kt')
-rw-r--r--kotlinx-coroutines-core/common/test/channels/ProduceTest.kt6
1 files changed, 3 insertions, 3 deletions
diff --git a/kotlinx-coroutines-core/common/test/channels/ProduceTest.kt b/kotlinx-coroutines-core/common/test/channels/ProduceTest.kt
index 194504e7..61ef0726 100644
--- a/kotlinx-coroutines-core/common/test/channels/ProduceTest.kt
+++ b/kotlinx-coroutines-core/common/test/channels/ProduceTest.kt
@@ -24,7 +24,7 @@ class ProduceTest : TestBase() {
expect(4)
check(c.receive() == 2)
expect(5)
- check(c.receiveOrNull() == null)
+ assertNull(c.receiveCatching().getOrNull())
finish(7)
}
@@ -49,7 +49,7 @@ class ProduceTest : TestBase() {
expect(4)
c.cancel()
expect(5)
- assertFailsWith<CancellationException> { c.receiveOrNull() }
+ assertFailsWith<CancellationException> { c.receiveCatching().getOrThrow() }
expect(6)
yield() // to produce
finish(8)
@@ -76,7 +76,7 @@ class ProduceTest : TestBase() {
expect(4)
c.cancel(TestCancellationException())
try {
- assertNull(c.receiveOrNull())
+ c.receive()
expectUnreached()
} catch (e: TestCancellationException) {
expect(5)