File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
kotlinx-coroutines-core/common/test Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,12 @@ abstract class MainDispatcherTestBase: TestBase() {
15
15
open fun checkNotMainThread () {}
16
16
17
17
/* * Runs the given block as a test, unless [shouldSkipTesting] indicates that the environment is not suitable. */
18
- fun runTestOrSkip (block : suspend CoroutineScope .() -> Unit ) {
19
- if (shouldSkipTesting()) return
20
- runTest(block = block)
18
+ fun runTestOrSkip (block : suspend CoroutineScope .() -> Unit ): TestResult {
19
+ // written as a block body to make the need to return `TestResult` explicit
20
+ return runTest {
21
+ if (shouldSkipTesting()) return @runTest
22
+ block()
23
+ }
21
24
}
22
25
23
26
/* * Tests the [toString] behavior of [Dispatchers.Main] and [MainCoroutineDispatcher.immediate] */
You can’t perform that action at this time.
0 commit comments