From d57e1bb68b9a35f97729e18f2bd8fb0db8f84309 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Wed, 11 Jul 2018 04:42:17 +0300 Subject: [PATCH] Migrate stepping and evaluation tests to the new coroutine API --- .../debugger/tinyApp/src/forTests/coroutines.kt | 12 ++++++------ .../stepping/stepOver/soSuspendableCallInEndOfFun.kt | 4 ++-- .../stepOver/soSuspendableCallInEndOfLambda.kt | 4 ++-- .../src/stepping/stepOver/soSuspendableCallInFun.kt | 4 ++-- .../soSuspendableCallInFunFromOtherStepping.kt | 4 ++-- .../stepping/stepOver/soSuspendableCallInLambda.kt | 4 ++-- .../stepOverForce/sofSuspendableCallInFun.kt | 4 ++-- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/idea/testData/debugger/tinyApp/src/forTests/coroutines.kt b/idea/testData/debugger/tinyApp/src/forTests/coroutines.kt index ca0c44a1630..dd9c2da2219 100644 --- a/idea/testData/debugger/tinyApp/src/forTests/coroutines.kt +++ b/idea/testData/debugger/tinyApp/src/forTests/coroutines.kt @@ -1,18 +1,18 @@ package forTests -import kotlin.coroutines.experimental.Continuation -import kotlin.coroutines.experimental.CoroutineContext -import kotlin.coroutines.experimental.EmptyCoroutineContext -import kotlin.coroutines.experimental.startCoroutine +import kotlin.coroutines.Continuation +import kotlin.coroutines.CoroutineContext +import kotlin.coroutines.EmptyCoroutineContext +import kotlin.coroutines.startCoroutine import java.util.concurrent.CountDownLatch import java.util.concurrent.TimeUnit open class EmptyContinuation(override val context: CoroutineContext = EmptyCoroutineContext) : Continuation { companion object : EmptyContinuation() - override fun resume(data: Any?) {} - override fun resumeWithException(exception: Throwable) { throw exception } + override fun resumeWith(result: SuccessOrFailure) { result.getOrThrow() } } + fun builder(c: suspend () -> Unit) { c.startCoroutine(EmptyContinuation) } diff --git a/idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInEndOfFun.kt b/idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInEndOfFun.kt index 4368bd3a084..dc7f7b97e6c 100644 --- a/idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInEndOfFun.kt +++ b/idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInEndOfFun.kt @@ -2,8 +2,8 @@ package soSuspendableCallInEndOfFun import forTests.WaitFinish import forTests.builder -import kotlin.coroutines.experimental.Continuation -import kotlin.coroutines.experimental.suspendCoroutine +import kotlin.coroutines.Continuation +import kotlin.coroutines.* private fun foo(a: Any) {} diff --git a/idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInEndOfLambda.kt b/idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInEndOfLambda.kt index bd4b18bfacf..944368748b5 100644 --- a/idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInEndOfLambda.kt +++ b/idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInEndOfLambda.kt @@ -2,8 +2,8 @@ package soSuspendableCallInEndOfLambda import forTests.builder import forTests.WaitFinish -import kotlin.coroutines.experimental.Continuation -import kotlin.coroutines.experimental.suspendCoroutine +import kotlin.coroutines.Continuation +import kotlin.coroutines.* private fun foo(a: Any) {} diff --git a/idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInFun.kt b/idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInFun.kt index 2164797453e..6fd3bb8efef 100644 --- a/idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInFun.kt +++ b/idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInFun.kt @@ -2,8 +2,8 @@ package soSuspendableCallInFun import forTests.builder import forTests.WaitFinish -import kotlin.coroutines.experimental.Continuation -import kotlin.coroutines.experimental.suspendCoroutine +import kotlin.coroutines.Continuation +import kotlin.coroutines.* private fun foo(a: Any) {} diff --git a/idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInFunFromOtherStepping.kt b/idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInFunFromOtherStepping.kt index dbbab8c6447..4a9ddd423a4 100644 --- a/idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInFunFromOtherStepping.kt +++ b/idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInFunFromOtherStepping.kt @@ -2,8 +2,8 @@ package soSuspendableCallInFunFromOtherStepping import forTests.builder import forTests.WaitFinish -import kotlin.coroutines.experimental.Continuation -import kotlin.coroutines.experimental.suspendCoroutine +import kotlin.coroutines.Continuation +import kotlin.coroutines.* private fun foo(a: Any) {} diff --git a/idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInLambda.kt b/idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInLambda.kt index bae1840e49c..41b6301f5bd 100644 --- a/idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInLambda.kt +++ b/idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInLambda.kt @@ -2,8 +2,8 @@ package soSuspendableCallInLambda import forTests.builder import forTests.WaitFinish -import kotlin.coroutines.experimental.Continuation -import kotlin.coroutines.experimental.suspendCoroutine +import kotlin.coroutines.Continuation +import kotlin.coroutines.* private fun foo(a: Any) {} diff --git a/idea/testData/debugger/tinyApp/src/stepping/stepOverForce/sofSuspendableCallInFun.kt b/idea/testData/debugger/tinyApp/src/stepping/stepOverForce/sofSuspendableCallInFun.kt index edc5ea1234d..06a8d08c057 100644 --- a/idea/testData/debugger/tinyApp/src/stepping/stepOverForce/sofSuspendableCallInFun.kt +++ b/idea/testData/debugger/tinyApp/src/stepping/stepOverForce/sofSuspendableCallInFun.kt @@ -2,8 +2,8 @@ package sofSuspendableCallInFun import forTests.builder import forTests.WaitFinish -import kotlin.coroutines.experimental.Continuation -import kotlin.coroutines.experimental.suspendCoroutine +import kotlin.coroutines.Continuation +import kotlin.coroutines.* private fun foo(a: Any) {}