[Test] Update or drop some IDE tests about experimental coroutines
This commit is contained in:
@@ -1,8 +0,0 @@
|
|||||||
suspend fun foo() {
|
|
||||||
corou<caret>
|
|
||||||
}
|
|
||||||
|
|
||||||
// LANGUAGE_VERSION: 1.2
|
|
||||||
// EXIST_JAVA_ONLY: {"lookupString":"coroutineContext","tailText":" (kotlin.coroutines.experimental)","typeText":"CoroutineContext","attributes":"","allLookupStrings":"coroutineContext, getCoroutineContext","itemText":"coroutineContext"}
|
|
||||||
// ABSENT: {"lookupString":"coroutineContext","tailText":" (kotlin.coroutines)","typeText":"CoroutineContext","attributes":"","allLookupStrings":"coroutineContext, getCoroutineContext","itemText":"coroutineContext"}
|
|
||||||
// ABSENT: {"lookupString":"coroutineContext","tailText":" (kotlin.coroutines.experimental.intrinsics)","typeText":"CoroutineContext","attributes":"","allLookupStrings":"coroutineContext, getCoroutineContext","itemText":"coroutineContext"}
|
|
||||||
-5
@@ -91,11 +91,6 @@ public class JSBasicCompletionTestGenerated extends AbstractJSBasicCompletionTes
|
|||||||
runTest("idea/idea-completion/testData/basic/common/ConsiderExtensionType.kt");
|
runTest("idea/idea-completion/testData/basic/common/ConsiderExtensionType.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("CoroutineContext.kt")
|
|
||||||
public void testCoroutineContext() throws Exception {
|
|
||||||
runTest("idea/idea-completion/testData/basic/common/CoroutineContext.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("CoroutineContextReleaseCoroutines.kt")
|
@TestMetadata("CoroutineContextReleaseCoroutines.kt")
|
||||||
public void testCoroutineContextReleaseCoroutines() throws Exception {
|
public void testCoroutineContextReleaseCoroutines() throws Exception {
|
||||||
runTest("idea/idea-completion/testData/basic/common/CoroutineContextReleaseCoroutines.kt");
|
runTest("idea/idea-completion/testData/basic/common/CoroutineContextReleaseCoroutines.kt");
|
||||||
|
|||||||
-5
@@ -91,11 +91,6 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT
|
|||||||
runTest("idea/idea-completion/testData/basic/common/ConsiderExtensionType.kt");
|
runTest("idea/idea-completion/testData/basic/common/ConsiderExtensionType.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("CoroutineContext.kt")
|
|
||||||
public void testCoroutineContext() throws Exception {
|
|
||||||
runTest("idea/idea-completion/testData/basic/common/CoroutineContext.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("CoroutineContextReleaseCoroutines.kt")
|
@TestMetadata("CoroutineContextReleaseCoroutines.kt")
|
||||||
public void testCoroutineContextReleaseCoroutines() throws Exception {
|
public void testCoroutineContextReleaseCoroutines() throws Exception {
|
||||||
runTest("idea/idea-completion/testData/basic/common/CoroutineContextReleaseCoroutines.kt");
|
runTest("idea/idea-completion/testData/basic/common/CoroutineContextReleaseCoroutines.kt");
|
||||||
|
|||||||
-5
@@ -91,11 +91,6 @@ public class HighLevelJvmBasicCompletionTestGenerated extends AbstractHighLevelJ
|
|||||||
runTest("idea/idea-completion/testData/basic/common/ConsiderExtensionType.kt");
|
runTest("idea/idea-completion/testData/basic/common/ConsiderExtensionType.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("CoroutineContext.kt")
|
|
||||||
public void testCoroutineContext() throws Exception {
|
|
||||||
runTest("idea/idea-completion/testData/basic/common/CoroutineContext.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("CoroutineContextReleaseCoroutines.kt")
|
@TestMetadata("CoroutineContextReleaseCoroutines.kt")
|
||||||
public void testCoroutineContextReleaseCoroutines() throws Exception {
|
public void testCoroutineContextReleaseCoroutines() throws Exception {
|
||||||
runTest("idea/idea-completion/testData/basic/common/CoroutineContextReleaseCoroutines.kt");
|
runTest("idea/idea-completion/testData/basic/common/CoroutineContextReleaseCoroutines.kt");
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
// "Make block type suspend" "true"
|
// "Make block type suspend" "true"
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
import kotlin.coroutines.experimental.suspendCoroutine
|
import kotlin.coroutines.suspendCoroutine
|
||||||
import kotlin.coroutines.experimental.createCoroutine
|
import kotlin.coroutines.createCoroutine
|
||||||
|
|
||||||
suspend fun <T> suspending(): T {
|
suspend fun <T> suspending(): T {
|
||||||
val block: () -> T = { null!! }
|
val block: () -> T = { null!! }
|
||||||
return suspendCoroutine { block.<caret>createCoroutine(it) }
|
return suspendCoroutine { block.<caret>createCoroutine(it) }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
// "Make block type suspend" "true"
|
// "Make block type suspend" "true"
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
import kotlin.coroutines.experimental.suspendCoroutine
|
import kotlin.coroutines.suspendCoroutine
|
||||||
import kotlin.coroutines.experimental.createCoroutine
|
import kotlin.coroutines.createCoroutine
|
||||||
|
|
||||||
suspend fun <T> suspending(): T {
|
suspend fun <T> suspending(): T {
|
||||||
val block: suspend () -> T = { null!! }
|
val block: suspend () -> T = { null!! }
|
||||||
return suspendCoroutine { block.createCoroutine(it) }
|
return suspendCoroutine { block.createCoroutine(it) }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// "Make block type suspend" "true"
|
// "Make block type suspend" "true"
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
import kotlin.coroutines.experimental.suspendCoroutine
|
import kotlin.coroutines.suspendCoroutine
|
||||||
import kotlin.coroutines.experimental.startCoroutine
|
import kotlin.coroutines.startCoroutine
|
||||||
|
|
||||||
suspend fun <T> suspending(block: () -> T): T = suspendCoroutine { block.<caret>startCoroutine(it) }
|
suspend fun <T> suspending(block: () -> T): T = suspendCoroutine { block.<caret>startCoroutine(it) }
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// "Make block type suspend" "true"
|
// "Make block type suspend" "true"
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
import kotlin.coroutines.experimental.suspendCoroutine
|
import kotlin.coroutines.suspendCoroutine
|
||||||
import kotlin.coroutines.experimental.startCoroutine
|
import kotlin.coroutines.startCoroutine
|
||||||
|
|
||||||
suspend fun <T> suspending(block: suspend () -> T): T = suspendCoroutine { block.startCoroutine(it) }
|
suspend fun <T> suspending(block: suspend () -> T): T = suspendCoroutine { block.startCoroutine(it) }
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
org.jetbrains.kotlin.idea.inspections.migration.ObsoleteExperimentalCoroutinesInspection
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
// "Fix experimental coroutines usage" "true"
|
|
||||||
// ERROR: Using 'buildIterator(noinline suspend SequenceScope<T>.() -> Unit): Iterator<T>' is an error. Use 'iterator { }' function instead.
|
|
||||||
// WITH_RUNTIME
|
|
||||||
import kotlin.coroutines.<caret>experimental.buildIterator
|
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
|
||||||
val lazySeq = buildIterator<Int> {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
// "Fix experimental coroutines usage" "true"
|
|
||||||
// ERROR: Using 'buildIterator(noinline suspend SequenceScope<T>.() -> Unit): Iterator<T>' is an error. Use 'iterator { }' function instead.
|
|
||||||
// WITH_RUNTIME<caret>
|
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
|
||||||
val lazySeq = buildIterator<Int> {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
// "Fix experimental coroutines usage" "true"
|
|
||||||
// WITH_RUNTIME
|
|
||||||
package some
|
|
||||||
|
|
||||||
import kotlin.coroutines.experimental.buildSequence
|
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
|
||||||
val lazySeq = <caret>buildSequence<Int> {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
// "Fix experimental coroutines usage" "true"
|
|
||||||
// WITH_RUNTIME
|
|
||||||
package some
|
|
||||||
|
|
||||||
import kotlin.coroutines.experimental.buildSequence
|
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
|
||||||
val lazySeq = sequence<Int> {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
// "Fix experimental coroutines usage" "true"
|
|
||||||
// ERROR: Unresolved reference: buildSequence
|
|
||||||
import kotlin.coroutines.<caret>experimental.buildSequence
|
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
|
||||||
val lazySeq = buildSequence<Int> {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
// "Fix experimental coroutines usage" "true"
|
|
||||||
// ERROR: Unresolved reference: buildSequence
|
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
|
||||||
val lazySeq = buildSequence<Int> {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
// "Fix experimental coroutines usages in the project" "true"
|
|
||||||
// WITH_RUNTIME
|
|
||||||
package migrate
|
|
||||||
|
|
||||||
import kotlin.coroutines.experimental.buildIterator
|
|
||||||
import kotlin.coroutines.experimental.buildSequence
|
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
|
||||||
val one = <caret>buildSequence {
|
|
||||||
yield(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
val two = buildIterator {
|
|
||||||
yield(1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
// "Fix experimental coroutines usages in the project" "true"
|
|
||||||
// WITH_RUNTIME
|
|
||||||
package migrate
|
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
|
||||||
val one = sequence {
|
|
||||||
yield(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
val two = iterator {
|
|
||||||
yield(1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
// "Fix experimental coroutines usage" "true"
|
|
||||||
// SHOULD_BE_AVAILABLE_AFTER_EXECUTION
|
|
||||||
// WITH_RUNTIME
|
|
||||||
|
|
||||||
import kotlin.coroutines.experimental.Continuation
|
|
||||||
|
|
||||||
fun test(con: Continuation<Int>) {
|
|
||||||
con.<caret>resume(12)
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
// "Fix experimental coroutines usage" "true"
|
|
||||||
// SHOULD_BE_AVAILABLE_AFTER_EXECUTION
|
|
||||||
// WITH_RUNTIME
|
|
||||||
|
|
||||||
import kotlin.coroutines.experimental.Continuation
|
|
||||||
import kotlin.coroutines.resume
|
|
||||||
|
|
||||||
fun test(con: Continuation<Int>) {
|
|
||||||
con.<caret>resume(12)
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
// "Fix experimental coroutines usage" "true"
|
|
||||||
// SHOULD_BE_AVAILABLE_AFTER_EXECUTION
|
|
||||||
// WITH_RUNTIME
|
|
||||||
|
|
||||||
import kotlin.coroutines.experimental.Continuation
|
|
||||||
|
|
||||||
fun test(con: Continuation<Int>) {
|
|
||||||
con.<caret>resumeWithException(RuntimeException("Haha"))
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
// "Fix experimental coroutines usage" "true"
|
|
||||||
// SHOULD_BE_AVAILABLE_AFTER_EXECUTION
|
|
||||||
// WITH_RUNTIME
|
|
||||||
|
|
||||||
import kotlin.coroutines.experimental.Continuation
|
|
||||||
import kotlin.coroutines.resumeWithException
|
|
||||||
|
|
||||||
fun test(con: Continuation<Int>) {
|
|
||||||
con.<caret>resumeWithException(RuntimeException("Haha"))
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
// "Fix experimental coroutines usage" "true"
|
|
||||||
|
|
||||||
import kotlin.coroutines.<caret>experimental.*
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
// "Fix experimental coroutines usage" "true"
|
|
||||||
|
|
||||||
import kotlin.coroutines.*
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
// "Fix experimental coroutines usage" "true"
|
|
||||||
// ERROR: Unresolved reference: kotlinx
|
|
||||||
|
|
||||||
import kotlinx.coroutines.<caret>experimental.delay
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
// "Fix experimental coroutines usage" "true"
|
|
||||||
// ERROR: Unresolved reference: kotlinx
|
|
||||||
|
|
||||||
import kotlinx.coroutines.delay
|
|
||||||
-13
@@ -3560,19 +3560,6 @@ public class QuickFixMultiFileTestGenerated extends AbstractQuickFixMultiFileTes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("idea/testData/quickfix/obsoleteCoroutines")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class ObsoleteCoroutines extends AbstractQuickFixMultiFileTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTestWithExtraFile, this, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInObsoleteCoroutines() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/quickfix/obsoleteCoroutines"), Pattern.compile("^(\\w+)\\.((before\\.Main\\.\\w+)|(test))$"), null, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("idea/testData/quickfix/obsoleteKotlinJsPackages")
|
@TestMetadata("idea/testData/quickfix/obsoleteKotlinJsPackages")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
|||||||
@@ -9960,59 +9960,6 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("idea/testData/quickfix/obsoleteCoroutines")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class ObsoleteCoroutines extends AbstractQuickFixTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInObsoleteCoroutines() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/quickfix/obsoleteCoroutines"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), null, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("buildIteratorImport.kt")
|
|
||||||
public void testBuildIteratorImport() throws Exception {
|
|
||||||
runTest("idea/testData/quickfix/obsoleteCoroutines/buildIteratorImport.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("buildSequence.kt")
|
|
||||||
public void testBuildSequence() throws Exception {
|
|
||||||
runTest("idea/testData/quickfix/obsoleteCoroutines/buildSequence.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("buildSequenceImport.kt")
|
|
||||||
public void testBuildSequenceImport() throws Exception {
|
|
||||||
runTest("idea/testData/quickfix/obsoleteCoroutines/buildSequenceImport.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("inProjectFix.kt")
|
|
||||||
public void testInProjectFix() throws Exception {
|
|
||||||
runTest("idea/testData/quickfix/obsoleteCoroutines/inProjectFix.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("resume.kt")
|
|
||||||
public void testResume() throws Exception {
|
|
||||||
runTest("idea/testData/quickfix/obsoleteCoroutines/resume.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("resumeWithException.kt")
|
|
||||||
public void testResumeWithException() throws Exception {
|
|
||||||
runTest("idea/testData/quickfix/obsoleteCoroutines/resumeWithException.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("starImport.kt")
|
|
||||||
public void testStarImport() throws Exception {
|
|
||||||
runTest("idea/testData/quickfix/obsoleteCoroutines/starImport.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("unresolvedKotlinxImport.kt")
|
|
||||||
public void testUnresolvedKotlinxImport() throws Exception {
|
|
||||||
runTest("idea/testData/quickfix/obsoleteCoroutines/unresolvedKotlinxImport.kt");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("idea/testData/quickfix/obsoleteKotlinJsPackages")
|
@TestMetadata("idea/testData/quickfix/obsoleteKotlinJsPackages")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
|||||||
Reference in New Issue
Block a user