aboutsummaryrefslogtreecommitdiffstats
path: root/reactive/kotlinx-coroutines-reactive/test/CancelledParentAttachTest.kt
diff options
context:
space:
mode:
Diffstat (limited to 'reactive/kotlinx-coroutines-reactive/test/CancelledParentAttachTest.kt')
-rw-r--r--reactive/kotlinx-coroutines-reactive/test/CancelledParentAttachTest.kt21
1 files changed, 21 insertions, 0 deletions
diff --git a/reactive/kotlinx-coroutines-reactive/test/CancelledParentAttachTest.kt b/reactive/kotlinx-coroutines-reactive/test/CancelledParentAttachTest.kt
new file mode 100644
index 00000000..1db10b27
--- /dev/null
+++ b/reactive/kotlinx-coroutines-reactive/test/CancelledParentAttachTest.kt
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
+ */
+
+package kotlinx.coroutines.reactive
+
+import kotlinx.coroutines.*
+import kotlinx.coroutines.flow.*
+import org.junit.*
+
+
+class CancelledParentAttachTest : TestBase() {;
+
+ @Test
+ fun testFlow() = runTest {
+ val f = flowOf(1, 2, 3).cancellable()
+ val j = Job().also { it.cancel() }
+ f.asPublisher(j).asFlow().collect()
+ }
+
+}