From 030aee45f2f43ea4cc11465e6cf8b2c3c741ec6f Mon Sep 17 00:00:00 2001 From: Roman Elizarov Date: Mon, 12 Oct 2020 22:23:39 +0300 Subject: [PATCH] Fixed FlowOnTest after the merge of branches --- .../common/test/flow/operators/FlowOnTest.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kotlinx-coroutines-core/common/test/flow/operators/FlowOnTest.kt b/kotlinx-coroutines-core/common/test/flow/operators/FlowOnTest.kt index 0eae1a3860..68653281cc 100644 --- a/kotlinx-coroutines-core/common/test/flow/operators/FlowOnTest.kt +++ b/kotlinx-coroutines-core/common/test/flow/operators/FlowOnTest.kt @@ -346,9 +346,10 @@ class FlowOnTest : TestBase() { fun testCancelledFlowOn() = runTest { assertFailsWith { coroutineScope { + val scope = this flow { emit(Unit) // emit to buffer - cancel() // now cancel + scope.cancel() // now cancel outer scope }.flowOn(wrapperDispatcher()).collect { // should not be reached, because cancelled before it runs expectUnreached()