Add ContinuationAdapter to coroutine tests helpers

It allows having the same Continuation implementations for different
API versions
This commit is contained in:
Denis Zharkov
2018-06-29 17:34:29 +03:00
parent f01e690f49
commit f23a0c8fea
33 changed files with 55 additions and 45 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST
// FULL_JDK
// WITH_COROUTINES
import java.util.concurrent.CompletableFuture
import COROUTINES_PACKAGE.*
@@ -48,7 +49,7 @@ fun box(): String {
fun <T> async(c: suspend () -> T): CompletableFuture<T> {
val future = CompletableFuture<T>()
c.startCoroutine(object : Continuation<T> {
c.startCoroutine(object : helpers.ContinuationAdapter<T>() {
override val context = EmptyCoroutineContext
override fun resume(data: T) {
+2 -1
View File
@@ -1,6 +1,7 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST
// FULL_JDK
// WITH_COROUTINES
import java.util.concurrent.CompletableFuture
import COROUTINES_PACKAGE.*
@@ -45,7 +46,7 @@ fun box(): String {
fun <T> async(c: suspend () -> T): CompletableFuture<T> {
val future = CompletableFuture<T>()
c.startCoroutine(object : Continuation<T> {
c.startCoroutine(object : helpers.ContinuationAdapter<T>() {
override val context = EmptyCoroutineContext
override fun resume(data: T) {