File tree Expand file tree Collapse file tree 3 files changed +3
-13
lines changed
common/kotlinx-coroutines-core-common/src/test/kotlin/kotlinx/coroutines/experimental
core/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental
js/kotlinx-coroutines-core-js/src/test/kotlin/kotlinx/coroutines/experimental Expand file tree Collapse file tree 3 files changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -31,9 +31,5 @@ public expect open class TestBase constructor() {
3131 expected : ((Throwable ) -> Boolean )? = null,
3232 unhandled : List <(Throwable ) -> Boolean > = emptyList(),
3333 block : suspend CoroutineScope .() -> Unit
34- ): TestResult
34+ )
3535}
36-
37- // todo: This is a work-around for missing suspend tests, see KT-22228
38- @Suppress(" NO_ACTUAL_FOR_EXPECT" )
39- expect class TestResult
Original file line number Diff line number Diff line change @@ -149,6 +149,3 @@ public actual open class TestBase actual constructor() {
149149 error(" Too few unhandled exceptions $exCount , expected ${unhandled.size} " )
150150 }
151151}
152-
153- @Suppress(" ACTUAL_WITHOUT_EXPECT" )
154- actual typealias TestResult = Unit
Original file line number Diff line number Diff line change @@ -61,11 +61,12 @@ public actual open class TestBase actual constructor() {
6161 finished = true
6262 }
6363
64+ // todo: The dynamic (promise) result is a work-around for missing suspend tests, see KT-22228
6465 public actual fun runTest (
6566 expected : ((Throwable ) -> Boolean )? = null,
6667 unhandled : List <(Throwable ) -> Boolean > = emptyList(),
6768 block : suspend CoroutineScope .() -> Unit
68- ): TestResult {
69+ ): dynamic {
6970 var exCount = 0
7071 var ex: Throwable ? = null
7172 return promise(block = block, context = CoroutineExceptionHandler { context, e ->
@@ -95,7 +96,3 @@ public actual open class TestBase actual constructor() {
9596
9697private fun <T > Promise<T>.finally (block : () -> Unit ): Promise <T > =
9798 then(onFulfilled = { value -> block(); value }, onRejected = { ex -> block(); throw ex })
98-
99- // todo: This is a work-around for missing suspend tests, see KT-22228
100- @Suppress(" ACTUAL_TYPE_ALIAS_TO_CLASS_WITH_DECLARATION_SITE_VARIANCE" , " ACTUAL_WITHOUT_EXPECT" )
101- actual typealias TestResult = Promise <Any ?>
You can’t perform that action at this time.
0 commit comments