Skip to content

Commit 32ffab8

Browse files
committed
remove subscribed assert + reword
1 parent 2bc88ed commit 32ffab8

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

kotlinx-coroutines-core/common/test/flow/channels/ChannelFlowTest.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,11 @@ class ChannelFlowTest : TestBase() {
206206
}
207207

208208
@Test
209-
fun testDoesntDispatchWhenUnnecessarilyWhenCollected() = runTest {
209+
fun testDoesntDispatchUnnecessarilyWhenCollected() = runTest {
210210
expect(1)
211-
var subscribed = false
212211
val myFlow = flow<Int> {
213212
expect(3)
214-
subscribed = true
215-
yield()
213+
yield() // In other words, testing that this will be the first suspension point in `collectLatest`.
216214
expect(5)
217215
}
218216
launch(start = CoroutineStart.UNDISPATCHED) {
@@ -223,6 +221,5 @@ class ChannelFlowTest : TestBase() {
223221
finish(6)
224222
}
225223
expect(4)
226-
assertTrue(subscribed)
227224
}
228225
}

0 commit comments

Comments
 (0)