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() {
31
31
expected : ((Throwable ) -> Boolean )? = null,
32
32
unhandled : List <(Throwable ) -> Boolean > = emptyList(),
33
33
block : suspend CoroutineScope .() -> Unit
34
- ): TestResult
34
+ )
35
35
}
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() {
149
149
error(" Too few unhandled exceptions $exCount , expected ${unhandled.size} " )
150
150
}
151
151
}
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() {
61
61
finished = true
62
62
}
63
63
64
+ // todo: The dynamic (promise) result is a work-around for missing suspend tests, see KT-22228
64
65
public actual fun runTest (
65
66
expected : ((Throwable ) -> Boolean )? = null,
66
67
unhandled : List <(Throwable ) -> Boolean > = emptyList(),
67
68
block : suspend CoroutineScope .() -> Unit
68
- ): TestResult {
69
+ ): dynamic {
69
70
var exCount = 0
70
71
var ex: Throwable ? = null
71
72
return promise(block = block, context = CoroutineExceptionHandler { context, e ->
@@ -95,7 +96,3 @@ public actual open class TestBase actual constructor() {
95
96
96
97
private fun <T > Promise<T>.finally (block : () -> Unit ): Promise <T > =
97
98
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