Skip to content

Commit 2ae42b9

Browse files
satoshunelizarov
authored andcommitted
Fix kotlinx-coroutines-test README: using runBlockingTest with testFooWithTimeout method
1 parent 3428774 commit 2ae42b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kotlinx-coroutines-test/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ example an uncompleted `Deferred<Foo>` is provided to the function under test vi
158158

159159
```kotlin
160160
@Test(expected = TimeoutCancellationException::class)
161-
fun testFooWithTimeout() {
161+
fun testFooWithTimeout() = runBlockingTest {
162162
val uncompleted = CompletableDeferred<Foo>() // this Deferred<Foo> will never complete
163163
foo(uncompleted)
164164
advanceTimeBy(1_000) // advance time, which will cause the timeout to throw an exception

0 commit comments

Comments
 (0)