Skip to content

Commit 24edb02

Browse files
elizarovrecheej
authored andcommitted
Fixed FlowOnTest after the merge of branches
1 parent 338c209 commit 24edb02

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kotlinx-coroutines-core/common/test/flow/operators/FlowOnTest.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,10 @@ class FlowOnTest : TestBase() {
346346
fun testCancelledFlowOn() = runTest {
347347
assertFailsWith<CancellationException> {
348348
coroutineScope {
349+
val scope = this
349350
flow {
350351
emit(Unit) // emit to buffer
351-
cancel() // now cancel
352+
scope.cancel() // now cancel outer scope
352353
}.flowOn(wrapperDispatcher()).collect {
353354
// should not be reached, because cancelled before it runs
354355
expectUnreached()

0 commit comments

Comments
 (0)