diff options
Diffstat (limited to 'kotlinx-coroutines-core/jvm/test/RunBlockingTest.kt')
-rw-r--r-- | kotlinx-coroutines-core/jvm/test/RunBlockingTest.kt | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/kotlinx-coroutines-core/jvm/test/RunBlockingTest.kt b/kotlinx-coroutines-core/jvm/test/RunBlockingTest.kt index e20362ff..de38df6b 100644 --- a/kotlinx-coroutines-core/jvm/test/RunBlockingTest.kt +++ b/kotlinx-coroutines-core/jvm/test/RunBlockingTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + * Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. */ package kotlinx.coroutines @@ -171,4 +171,15 @@ class RunBlockingTest : TestBase() { } rb.hashCode() // unused } + + @Test + fun testCancelledParent() { + val job = Job() + job.cancel() + assertFailsWith<CancellationException> { + runBlocking(job) { + expectUnreached() + } + } + } } |