[Test] Drop codegen tests for experimental coroutines
Experimental coroutines was deprecated in Kotlin 1.3, so since Kotlin 1.5 we don't support (and don't test) them
This commit is contained in:
committed by
TeamCityServer
parent
d547ce7c42
commit
e0cd830a0e
-142
@@ -1,142 +0,0 @@
|
|||||||
// !LANGUAGE: -ReleaseCoroutines -ExperimentalBuilderInference
|
|
||||||
// IGNORE_BACKEND: JVM_IR
|
|
||||||
// IGNORE_BACKEND: JS
|
|
||||||
// WITH_RUNTIME
|
|
||||||
// WITH_COROUTINES
|
|
||||||
// DONT_TARGET_EXACT_BACKEND: JS_IR
|
|
||||||
// DONT_TARGET_EXACT_BACKEND: JS_IR_ES6
|
|
||||||
|
|
||||||
import helpers.*
|
|
||||||
import kotlin.coroutines.experimental.*
|
|
||||||
import kotlin.coroutines.experimental.intrinsics.*
|
|
||||||
|
|
||||||
interface AsyncGenerator<in T> {
|
|
||||||
suspend fun yield(value: T)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface AsyncSequence<out T> {
|
|
||||||
operator fun iterator(): AsyncIterator<T>
|
|
||||||
}
|
|
||||||
|
|
||||||
interface AsyncIterator<out T> {
|
|
||||||
operator suspend fun hasNext(): Boolean
|
|
||||||
operator suspend fun next(): T
|
|
||||||
}
|
|
||||||
|
|
||||||
fun <T> asyncGenerate(block: suspend AsyncGenerator<T>.() -> Unit): AsyncSequence<T> = object : AsyncSequence<T> {
|
|
||||||
override fun iterator(): AsyncIterator<T> {
|
|
||||||
val iterator = AsyncGeneratorIterator<T>()
|
|
||||||
iterator.nextStep = block.createCoroutine(receiver = iterator, completion = iterator)
|
|
||||||
return iterator
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class AsyncGeneratorIterator<T>: AsyncIterator<T>, AsyncGenerator<T>, ContinuationAdapter<Unit>() {
|
|
||||||
var computedNext = false
|
|
||||||
var nextValue: T? = null
|
|
||||||
var nextStep: Continuation<Unit>? = null
|
|
||||||
|
|
||||||
// if (computesNext) computeContinuation is Continuation<T>
|
|
||||||
// if (!computesNext) computeContinuation is Continuation<Boolean>
|
|
||||||
var computesNext = false
|
|
||||||
var computeContinuation: Continuation<*>? = null
|
|
||||||
|
|
||||||
override val context = EmptyCoroutineContext
|
|
||||||
|
|
||||||
suspend fun computeHasNext(): Boolean = suspendCoroutineUninterceptedOrReturn { c ->
|
|
||||||
computesNext = false
|
|
||||||
computeContinuation = c
|
|
||||||
nextStep!!.resume(Unit)
|
|
||||||
COROUTINE_SUSPENDED
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun computeNext(): T = suspendCoroutineUninterceptedOrReturn { c ->
|
|
||||||
computesNext = true
|
|
||||||
computeContinuation = c
|
|
||||||
nextStep!!.resume(Unit)
|
|
||||||
COROUTINE_SUSPENDED
|
|
||||||
}
|
|
||||||
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
|
||||||
fun resumeIterator(exception: Throwable?) {
|
|
||||||
if (exception != null) {
|
|
||||||
done()
|
|
||||||
computeContinuation!!.resumeWithException(exception)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (computesNext) {
|
|
||||||
computedNext = false
|
|
||||||
(computeContinuation as Continuation<T>).resume(nextValue as T)
|
|
||||||
} else {
|
|
||||||
(computeContinuation as Continuation<Boolean>).resume(nextStep != null)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override suspend fun hasNext(): Boolean {
|
|
||||||
if (!computedNext) return computeHasNext()
|
|
||||||
return nextStep != null
|
|
||||||
}
|
|
||||||
|
|
||||||
override suspend fun next(): T {
|
|
||||||
if (!computedNext) return computeNext()
|
|
||||||
computedNext = false
|
|
||||||
return nextValue as T
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun done() {
|
|
||||||
computedNext = true
|
|
||||||
nextStep = null
|
|
||||||
}
|
|
||||||
|
|
||||||
// Completion continuation implementation
|
|
||||||
override fun resume(value: Unit) {
|
|
||||||
done()
|
|
||||||
resumeIterator(null)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun resumeWithException(exception: Throwable) {
|
|
||||||
done()
|
|
||||||
resumeIterator(exception)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generator implementation
|
|
||||||
override suspend fun yield(value: T): Unit = suspendCoroutineUninterceptedOrReturn { c ->
|
|
||||||
computedNext = true
|
|
||||||
nextValue = value
|
|
||||||
nextStep = c
|
|
||||||
resumeIterator(null)
|
|
||||||
COROUTINE_SUSPENDED
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun builder(c: suspend () -> Unit) {
|
|
||||||
c.startCoroutine(EmptyContinuation)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun cst(a: Any?): String? = a as String?
|
|
||||||
fun any(a: Any?): Any? = a
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
val seq = asyncGenerate {
|
|
||||||
yield("O")
|
|
||||||
yield("K")
|
|
||||||
}
|
|
||||||
|
|
||||||
var res = ""
|
|
||||||
|
|
||||||
builder {
|
|
||||||
// type of `prev` should be j/l/Object everywhere (even in a expected type position)
|
|
||||||
var prev: Any? = null
|
|
||||||
for (i in seq) {
|
|
||||||
res += i
|
|
||||||
prev = any(res)
|
|
||||||
// merge of NULL_VALUE and j/l/Object should result in common j/l/Object value
|
|
||||||
// but it was NULL_VALUE and we do not spill null values, we just put
|
|
||||||
// ACONST_NULL after suspension point instead
|
|
||||||
}
|
|
||||||
|
|
||||||
res = cst(prev) ?: "fail 1"
|
|
||||||
}
|
|
||||||
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
-137
@@ -1,137 +0,0 @@
|
|||||||
// !LANGUAGE: -ReleaseCoroutines -ExperimentalBuilderInference
|
|
||||||
// IGNORE_BACKEND: JVM_IR
|
|
||||||
// IGNORE_BACKEND: JS
|
|
||||||
// WITH_RUNTIME
|
|
||||||
// WITH_COROUTINES
|
|
||||||
// DONT_TARGET_EXACT_BACKEND: JS_IR
|
|
||||||
// DONT_TARGET_EXACT_BACKEND: JS_IR_ES6
|
|
||||||
|
|
||||||
import helpers.*
|
|
||||||
import kotlin.coroutines.experimental.*
|
|
||||||
import kotlin.coroutines.experimental.intrinsics.*
|
|
||||||
|
|
||||||
interface AsyncGenerator<in T> {
|
|
||||||
suspend fun yield(value: T)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface AsyncSequence<out T> {
|
|
||||||
operator fun iterator(): AsyncIterator<T>
|
|
||||||
}
|
|
||||||
|
|
||||||
interface AsyncIterator<out T> {
|
|
||||||
operator suspend fun hasNext(): Boolean
|
|
||||||
operator suspend fun next(): T
|
|
||||||
}
|
|
||||||
|
|
||||||
fun <T> asyncGenerate(block: suspend AsyncGenerator<T>.() -> Unit): AsyncSequence<T> = object : AsyncSequence<T> {
|
|
||||||
override fun iterator(): AsyncIterator<T> {
|
|
||||||
val iterator = AsyncGeneratorIterator<T>()
|
|
||||||
iterator.nextStep = block.createCoroutine(receiver = iterator, completion = iterator)
|
|
||||||
return iterator
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class AsyncGeneratorIterator<T>: AsyncIterator<T>, AsyncGenerator<T>, ContinuationAdapter<Unit>() {
|
|
||||||
var computedNext = false
|
|
||||||
var nextValue: T? = null
|
|
||||||
var nextStep: Continuation<Unit>? = null
|
|
||||||
|
|
||||||
// if (computesNext) computeContinuation is Continuation<T>
|
|
||||||
// if (!computesNext) computeContinuation is Continuation<Boolean>
|
|
||||||
var computesNext = false
|
|
||||||
var computeContinuation: Continuation<*>? = null
|
|
||||||
|
|
||||||
override val context = EmptyCoroutineContext
|
|
||||||
|
|
||||||
suspend fun computeHasNext(): Boolean = suspendCoroutineUninterceptedOrReturn { c ->
|
|
||||||
computesNext = false
|
|
||||||
computeContinuation = c
|
|
||||||
nextStep!!.resume(Unit)
|
|
||||||
COROUTINE_SUSPENDED
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun computeNext(): T = suspendCoroutineUninterceptedOrReturn { c ->
|
|
||||||
computesNext = true
|
|
||||||
computeContinuation = c
|
|
||||||
nextStep!!.resume(Unit)
|
|
||||||
COROUTINE_SUSPENDED
|
|
||||||
}
|
|
||||||
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
|
||||||
fun resumeIterator(exception: Throwable?) {
|
|
||||||
if (exception != null) {
|
|
||||||
done()
|
|
||||||
computeContinuation!!.resumeWithException(exception)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (computesNext) {
|
|
||||||
computedNext = false
|
|
||||||
(computeContinuation as Continuation<T>).resume(nextValue as T)
|
|
||||||
} else {
|
|
||||||
(computeContinuation as Continuation<Boolean>).resume(nextStep != null)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override suspend fun hasNext(): Boolean {
|
|
||||||
if (!computedNext) return computeHasNext()
|
|
||||||
return nextStep != null
|
|
||||||
}
|
|
||||||
|
|
||||||
override suspend fun next(): T {
|
|
||||||
if (!computedNext) return computeNext()
|
|
||||||
computedNext = false
|
|
||||||
return nextValue as T
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun done() {
|
|
||||||
computedNext = true
|
|
||||||
nextStep = null
|
|
||||||
}
|
|
||||||
|
|
||||||
// Completion continuation implementation
|
|
||||||
override fun resume(value: Unit) {
|
|
||||||
done()
|
|
||||||
resumeIterator(null)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun resumeWithException(exception: Throwable) {
|
|
||||||
done()
|
|
||||||
resumeIterator(exception)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generator implementation
|
|
||||||
override suspend fun yield(value: T): Unit = suspendCoroutineUninterceptedOrReturn { c ->
|
|
||||||
computedNext = true
|
|
||||||
nextValue = value
|
|
||||||
nextStep = c
|
|
||||||
resumeIterator(null)
|
|
||||||
COROUTINE_SUSPENDED
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun <T> AsyncSequence<T>.toList(): List<T> {
|
|
||||||
val out = arrayListOf<T>()
|
|
||||||
for (e in this@toList) out += e // fails at this line
|
|
||||||
return out
|
|
||||||
}
|
|
||||||
|
|
||||||
fun builder(c: suspend () -> Unit) {
|
|
||||||
c.startCoroutine(EmptyContinuation)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
val seq = asyncGenerate {
|
|
||||||
yield("O")
|
|
||||||
yield("K")
|
|
||||||
}
|
|
||||||
|
|
||||||
var res = listOf<String>()
|
|
||||||
|
|
||||||
builder {
|
|
||||||
res = seq.toList()
|
|
||||||
}
|
|
||||||
|
|
||||||
if (res.size > 2) return "fail 1: ${res.size}"
|
|
||||||
|
|
||||||
return res[0] + res[1]
|
|
||||||
}
|
|
||||||
-131
@@ -1,131 +0,0 @@
|
|||||||
// !LANGUAGE: -ReleaseCoroutines -ExperimentalBuilderInference
|
|
||||||
// IGNORE_BACKEND: JVM_IR
|
|
||||||
// IGNORE_BACKEND: JS
|
|
||||||
// WITH_RUNTIME
|
|
||||||
// WITH_COROUTINES
|
|
||||||
// DONT_TARGET_EXACT_BACKEND: JS_IR
|
|
||||||
// DONT_TARGET_EXACT_BACKEND: JS_IR_ES6
|
|
||||||
|
|
||||||
import helpers.*
|
|
||||||
import kotlin.coroutines.experimental.*
|
|
||||||
import kotlin.coroutines.experimental.intrinsics.*
|
|
||||||
|
|
||||||
interface AsyncGenerator<in T> {
|
|
||||||
suspend fun yield(value: T)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface AsyncSequence<out T> {
|
|
||||||
operator fun iterator(): AsyncIterator<T>
|
|
||||||
}
|
|
||||||
|
|
||||||
interface AsyncIterator<out T> {
|
|
||||||
operator suspend fun hasNext(): Boolean
|
|
||||||
operator suspend fun next(): T
|
|
||||||
}
|
|
||||||
|
|
||||||
fun <T> asyncGenerate(block: suspend AsyncGenerator<T>.() -> Unit): AsyncSequence<T> = object : AsyncSequence<T> {
|
|
||||||
override fun iterator(): AsyncIterator<T> {
|
|
||||||
val iterator = AsyncGeneratorIterator<T>()
|
|
||||||
iterator.nextStep = block.createCoroutine(receiver = iterator, completion = iterator)
|
|
||||||
return iterator
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class AsyncGeneratorIterator<T>: AsyncIterator<T>, AsyncGenerator<T>, ContinuationAdapter<Unit>() {
|
|
||||||
var computedNext = false
|
|
||||||
var nextValue: T? = null
|
|
||||||
var nextStep: Continuation<Unit>? = null
|
|
||||||
|
|
||||||
// if (computesNext) computeContinuation is Continuation<T>
|
|
||||||
// if (!computesNext) computeContinuation is Continuation<Boolean>
|
|
||||||
var computesNext = false
|
|
||||||
var computeContinuation: Continuation<*>? = null
|
|
||||||
|
|
||||||
override val context = EmptyCoroutineContext
|
|
||||||
|
|
||||||
suspend fun computeHasNext(): Boolean = suspendCoroutineUninterceptedOrReturn { c ->
|
|
||||||
computesNext = false
|
|
||||||
computeContinuation = c
|
|
||||||
nextStep!!.resume(Unit)
|
|
||||||
COROUTINE_SUSPENDED
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun computeNext(): T = suspendCoroutineUninterceptedOrReturn { c ->
|
|
||||||
computesNext = true
|
|
||||||
computeContinuation = c
|
|
||||||
nextStep!!.resume(Unit)
|
|
||||||
COROUTINE_SUSPENDED
|
|
||||||
}
|
|
||||||
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
|
||||||
fun resumeIterator(exception: Throwable?) {
|
|
||||||
if (exception != null) {
|
|
||||||
done()
|
|
||||||
computeContinuation!!.resumeWithException(exception)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (computesNext) {
|
|
||||||
computedNext = false
|
|
||||||
(computeContinuation as Continuation<T>).resume(nextValue as T)
|
|
||||||
} else {
|
|
||||||
(computeContinuation as Continuation<Boolean>).resume(nextStep != null)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override suspend fun hasNext(): Boolean {
|
|
||||||
if (!computedNext) return computeHasNext()
|
|
||||||
return nextStep != null
|
|
||||||
}
|
|
||||||
|
|
||||||
override suspend fun next(): T {
|
|
||||||
if (!computedNext) return computeNext()
|
|
||||||
computedNext = false
|
|
||||||
return nextValue as T
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun done() {
|
|
||||||
computedNext = true
|
|
||||||
nextStep = null
|
|
||||||
}
|
|
||||||
|
|
||||||
// Completion continuation implementation
|
|
||||||
override fun resume(value: Unit) {
|
|
||||||
done()
|
|
||||||
resumeIterator(null)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun resumeWithException(exception: Throwable) {
|
|
||||||
done()
|
|
||||||
resumeIterator(exception)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generator implementation
|
|
||||||
override suspend fun yield(value: T): Unit = suspendCoroutineUninterceptedOrReturn { c ->
|
|
||||||
computedNext = true
|
|
||||||
nextValue = value
|
|
||||||
nextStep = c
|
|
||||||
resumeIterator(null)
|
|
||||||
COROUTINE_SUSPENDED
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun builder(c: suspend () -> Unit) {
|
|
||||||
c.startCoroutine(EmptyContinuation)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
val seq = asyncGenerate {
|
|
||||||
yield("O")
|
|
||||||
yield("K")
|
|
||||||
}
|
|
||||||
|
|
||||||
var res = ""
|
|
||||||
|
|
||||||
builder {
|
|
||||||
for (i in seq) {
|
|
||||||
res += i
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
-51
@@ -1,51 +0,0 @@
|
|||||||
// !LANGUAGE: -ReleaseCoroutines
|
|
||||||
// IGNORE_BACKEND: JVM_IR
|
|
||||||
// IGNORE_BACKEND: JS
|
|
||||||
// WITH_RUNTIME
|
|
||||||
// WITH_COROUTINES
|
|
||||||
// DONT_TARGET_EXACT_BACKEND: JS_IR
|
|
||||||
// DONT_TARGET_EXACT_BACKEND: JS_IR_ES6
|
|
||||||
|
|
||||||
import helpers.*
|
|
||||||
import kotlin.coroutines.experimental.*
|
|
||||||
|
|
||||||
enum class Foo(vararg expected: String) {
|
|
||||||
A("start", "A", "end"),
|
|
||||||
B("start", "BCD", "end"),
|
|
||||||
C("start", "BCD", "end"),
|
|
||||||
D("start", "BCD", "end"),
|
|
||||||
E("start", "E", "end"),
|
|
||||||
F("start", "end");
|
|
||||||
|
|
||||||
val expected = expected.toList()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
for (c in Foo.values()) {
|
|
||||||
val actual = getSequence(c).toList()
|
|
||||||
if (actual != c.expected) {
|
|
||||||
return "FAIL: -- ${c.expected} != $actual"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return "OK"
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getSequence(a: Foo) =
|
|
||||||
buildSequence {
|
|
||||||
yield("start")
|
|
||||||
when (a) {
|
|
||||||
Foo.A -> {
|
|
||||||
yield("A")
|
|
||||||
}
|
|
||||||
Foo.B,
|
|
||||||
Foo.C,
|
|
||||||
Foo.D-> {
|
|
||||||
yield("BCD")
|
|
||||||
}
|
|
||||||
Foo.E-> {
|
|
||||||
yield("E")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
yield("end")
|
|
||||||
}
|
|
||||||
-35
@@ -1,35 +0,0 @@
|
|||||||
// !LANGUAGE: -ReleaseCoroutines
|
|
||||||
// IGNORE_BACKEND: JVM_IR
|
|
||||||
// TARGET_BACKEND: JVM
|
|
||||||
// WITH_REFLECT
|
|
||||||
// WITH_COROUTINES
|
|
||||||
|
|
||||||
import helpers.*
|
|
||||||
import kotlin.coroutines.experimental.*
|
|
||||||
import kotlin.coroutines.experimental.intrinsics.*
|
|
||||||
|
|
||||||
class A<T : String> {
|
|
||||||
suspend fun foo() {}
|
|
||||||
|
|
||||||
suspend fun bar(): T {
|
|
||||||
foo()
|
|
||||||
return suspendCoroutineUninterceptedOrReturn { x ->
|
|
||||||
x.resume(x.toString() as T)
|
|
||||||
COROUTINE_SUSPENDED
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun builder(c: suspend () -> Unit) {
|
|
||||||
c.startCoroutine(EmptyContinuation)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
var result = ""
|
|
||||||
|
|
||||||
builder {
|
|
||||||
result = A<String>().bar()
|
|
||||||
}
|
|
||||||
|
|
||||||
return if (result == "(kotlin.coroutines.experimental.Continuation<T>) -> kotlin.Any?") "OK" else "Fail: $result"
|
|
||||||
}
|
|
||||||
-98
@@ -1,98 +0,0 @@
|
|||||||
// !LANGUAGE: -ReleaseCoroutines
|
|
||||||
// WITH_RUNTIME
|
|
||||||
// WITH_COROUTINES
|
|
||||||
// DONT_TARGET_EXACT_BACKEND: JS_IR
|
|
||||||
// DONT_TARGET_EXACT_BACKEND: JS_IR_ES6
|
|
||||||
// IGNORE_BACKEND: JS
|
|
||||||
|
|
||||||
import kotlin.coroutines.experimental.*
|
|
||||||
import kotlin.coroutines.experimental.intrinsics.COROUTINE_SUSPENDED
|
|
||||||
|
|
||||||
fun runCustomLambdaAsCoroutine(e: Throwable? = null, x: (Continuation<String>) -> Any?): String {
|
|
||||||
var result = "fail"
|
|
||||||
var wasIntercepted = false
|
|
||||||
val c = (x as suspend () -> String).createCoroutine(object: helpers.ContinuationAdapter<String>() {
|
|
||||||
override fun resumeWithException(exception: Throwable) {
|
|
||||||
throw exception
|
|
||||||
}
|
|
||||||
|
|
||||||
override val context: CoroutineContext
|
|
||||||
get() = object: ContinuationInterceptor {
|
|
||||||
override fun <R> fold(initial: R, operation: (R, CoroutineContext.Element) -> R): R {
|
|
||||||
throw IllegalStateException()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun <E : CoroutineContext.Element> get(key: CoroutineContext.Key<E>): E? {
|
|
||||||
if (key == ContinuationInterceptor.Key) {
|
|
||||||
return this as E
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun <T> interceptContinuation(continuation: Continuation<T>) = object : helpers.ContinuationAdapter<T>() {
|
|
||||||
override val context: CoroutineContext
|
|
||||||
get() = continuation.context
|
|
||||||
|
|
||||||
override fun resume(value: T) {
|
|
||||||
wasIntercepted = true
|
|
||||||
continuation.resume(value)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun resumeWithException(exception: Throwable) {
|
|
||||||
wasIntercepted = true
|
|
||||||
continuation.resumeWithException(exception)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun minusKey(key: CoroutineContext.Key<*>): CoroutineContext {
|
|
||||||
throw IllegalStateException()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun plus(context: CoroutineContext): CoroutineContext {
|
|
||||||
throw IllegalStateException()
|
|
||||||
}
|
|
||||||
|
|
||||||
override val key: CoroutineContext.Key<*>
|
|
||||||
get() = ContinuationInterceptor.Key
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun resume(value: String) {
|
|
||||||
result = value
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
if (e != null)
|
|
||||||
c.resumeWithException(e)
|
|
||||||
else
|
|
||||||
c.resume(Unit)
|
|
||||||
|
|
||||||
if (!wasIntercepted) return "was not intercepted"
|
|
||||||
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
val x = runCustomLambdaAsCoroutine {
|
|
||||||
it.resume("OK")
|
|
||||||
COROUTINE_SUSPENDED
|
|
||||||
}
|
|
||||||
|
|
||||||
if (x != "OK") return "fail 1: $x"
|
|
||||||
|
|
||||||
val y = runCustomLambdaAsCoroutine {
|
|
||||||
"OK"
|
|
||||||
}
|
|
||||||
|
|
||||||
if (y != "OK") return "fail 2: $x"
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
|
||||||
runCustomLambdaAsCoroutine(RuntimeException("OK")) {
|
|
||||||
throw RuntimeException("fail 3")
|
|
||||||
}
|
|
||||||
} catch(e: Exception) {
|
|
||||||
return e.message!!
|
|
||||||
}
|
|
||||||
|
|
||||||
return "fail 3"
|
|
||||||
}
|
|
||||||
-23
@@ -1,23 +0,0 @@
|
|||||||
// !LANGUAGE: -ReleaseCoroutines
|
|
||||||
// IGNORE_BACKEND: JS_IR, JS
|
|
||||||
// IGNORE_BACKEND: JS_IR_ES6
|
|
||||||
// IGNORE_BACKEND: JVM_IR
|
|
||||||
// WITH_RUNTIME
|
|
||||||
// WITH_COROUTINES
|
|
||||||
|
|
||||||
// some classes are moved from stdlib to compatibility package
|
|
||||||
// IGNORE_BACKEND: ANDROID
|
|
||||||
|
|
||||||
import helpers.*
|
|
||||||
import kotlin.coroutines.*
|
|
||||||
|
|
||||||
val lambda1 = { x: Any -> } as (Any) -> Unit
|
|
||||||
val suspendLambda0: suspend () -> Unit = {}
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
assert(lambda1 is SuspendFunction0<*>) { "Failed: lambda1 !is SuspendFunction0<*>" }
|
|
||||||
assert(suspendLambda0 is Function1<*, *>) { "Failed: suspendLambda0 is Function1<*, *>" }
|
|
||||||
assert(suspendLambda0 is SuspendFunction0<*>) { "Failed: suspendLambda0 is SuspendFunction0<*>" }
|
|
||||||
|
|
||||||
return "OK"
|
|
||||||
}
|
|
||||||
-74
@@ -1,74 +0,0 @@
|
|||||||
// !LANGUAGE: -ReleaseCoroutines
|
|
||||||
// IGNORE_BACKEND: JVM_IR
|
|
||||||
// IGNORE_BACKEND: JS
|
|
||||||
// WITH_RUNTIME
|
|
||||||
// WITH_COROUTINES
|
|
||||||
|
|
||||||
import helpers.*
|
|
||||||
// TARGET_BACKEND: JVM
|
|
||||||
import kotlin.coroutines.experimental.*
|
|
||||||
import kotlin.coroutines.experimental.intrinsics.*
|
|
||||||
|
|
||||||
suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x ->
|
|
||||||
x.resume(Unit)
|
|
||||||
COROUTINE_SUSPENDED
|
|
||||||
}
|
|
||||||
|
|
||||||
fun builder1(c: suspend () -> Unit) {
|
|
||||||
(c as Continuation<Unit>).resume(Unit)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun builder2(c: suspend () -> Unit) {
|
|
||||||
val continuation = c.createCoroutine(EmptyContinuation)
|
|
||||||
|
|
||||||
val delegateField = continuation.javaClass.getDeclaredField("delegate")
|
|
||||||
delegateField.setAccessible(true)
|
|
||||||
val originalContinuation = delegateField.get(continuation)
|
|
||||||
|
|
||||||
val declaredField = originalContinuation.javaClass.superclass.getDeclaredField("label")
|
|
||||||
declaredField.setAccessible(true)
|
|
||||||
declaredField.set(originalContinuation, -3)
|
|
||||||
continuation.resume(Unit)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
|
|
||||||
try {
|
|
||||||
builder1 {
|
|
||||||
suspendHere()
|
|
||||||
}
|
|
||||||
return "fail 1"
|
|
||||||
} catch (e: kotlin.KotlinNullPointerException) {
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
builder2 {
|
|
||||||
suspendHere()
|
|
||||||
}
|
|
||||||
return "fail 3"
|
|
||||||
} catch (e: java.lang.IllegalStateException) {
|
|
||||||
if (e.message != "call to 'resume' before 'invoke' with coroutine") return "fail 4: ${e.message!!}"
|
|
||||||
}
|
|
||||||
|
|
||||||
var result = "OK"
|
|
||||||
|
|
||||||
try {
|
|
||||||
builder1 {
|
|
||||||
result = "fail 5"
|
|
||||||
}
|
|
||||||
return "fail 6"
|
|
||||||
} catch (e: kotlin.KotlinNullPointerException) {
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
builder2 {
|
|
||||||
result = "fail 8"
|
|
||||||
}
|
|
||||||
return "fail 9"
|
|
||||||
} catch (e: java.lang.IllegalStateException) {
|
|
||||||
if (e.message != "call to 'resume' before 'invoke' with coroutine") return "fail 10: ${e.message!!}"
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
return "fail"
|
|
||||||
}
|
|
||||||
Vendored
-45
@@ -1,45 +0,0 @@
|
|||||||
// !LANGUAGE: -ReleaseCoroutines
|
|
||||||
// IGNORE_BACKEND: JVM_IR
|
|
||||||
// TARGET_BACKEND: JVM
|
|
||||||
// WITH_COROUTINES
|
|
||||||
// WITH_RUNTIME
|
|
||||||
// MODULE: lib
|
|
||||||
// FILE: lib.kt
|
|
||||||
|
|
||||||
interface I {}
|
|
||||||
|
|
||||||
suspend inline fun foo() = object : I {}
|
|
||||||
|
|
||||||
// MODULE: useLib(lib)
|
|
||||||
// FILE: UseLib.java
|
|
||||||
import kotlin.coroutines.experimental.*;
|
|
||||||
import kotlin.Unit;
|
|
||||||
|
|
||||||
public class UseLib {
|
|
||||||
public static String useFoo() {
|
|
||||||
Object i = LibKt.foo(new MyContinuation());
|
|
||||||
return i.getClass().getName() + " " + i.getClass().getEnclosingClass().getName() + " " + i.getClass().getEnclosingClass().getEnclosingClass();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class MyContinuation implements Continuation<I> {
|
|
||||||
public CoroutineContext getContext() {
|
|
||||||
return EmptyCoroutineContext.INSTANCE;
|
|
||||||
}
|
|
||||||
public void resume(I value) {}
|
|
||||||
public void resumeWithException(Throwable e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// MODULE: main(useLib)
|
|
||||||
// FILE: main.kt
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
val res = UseLib.useFoo()
|
|
||||||
if (res == "LibKt\$foo\$2 LibKt null") {
|
|
||||||
return "OK"
|
|
||||||
} else {
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-20
@@ -1,20 +0,0 @@
|
|||||||
// !LANGUAGE: -ReleaseCoroutines
|
|
||||||
// WITH_COROUTINES
|
|
||||||
// WITH_REFLECT
|
|
||||||
// DONT_TARGET_EXACT_BACKEND: JS_IR
|
|
||||||
// DONT_TARGET_EXACT_BACKEND: JS_IR_ES6
|
|
||||||
|
|
||||||
// IGNORE_BACKEND: NATIVE
|
|
||||||
// IGNORE_BACKEND: JS
|
|
||||||
|
|
||||||
import helpers.*
|
|
||||||
import kotlin.coroutines.experimental.*
|
|
||||||
|
|
||||||
class A {
|
|
||||||
fun noArgs() = "OK"
|
|
||||||
}
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
if (A::noArgs.isSuspend) return "FAIL"
|
|
||||||
return "OK"
|
|
||||||
}
|
|
||||||
Vendored
-50
@@ -1,50 +0,0 @@
|
|||||||
// !LANGUAGE: -ReleaseCoroutines
|
|
||||||
// IGNORE_BACKEND: JVM_IR
|
|
||||||
// TARGET_BACKEND: JVM
|
|
||||||
// WITH_RUNTIME
|
|
||||||
// WITH_COROUTINES
|
|
||||||
|
|
||||||
// FILE: I.kt
|
|
||||||
|
|
||||||
interface I {
|
|
||||||
suspend fun foo(x: Int): String
|
|
||||||
suspend fun bar(x: Int): String
|
|
||||||
}
|
|
||||||
|
|
||||||
// FILE: JavaClass.java
|
|
||||||
|
|
||||||
public class JavaClass implements I {
|
|
||||||
@Override
|
|
||||||
public String foo(int x, kotlin.coroutines.experimental.Continuation<? super String> continuation) {
|
|
||||||
return "O";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object bar(int x, kotlin.coroutines.experimental.Continuation<? super String> continuation) {
|
|
||||||
return foo(x, continuation);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// FILE: main.kt
|
|
||||||
import helpers.*
|
|
||||||
import kotlin.coroutines.experimental.*
|
|
||||||
import kotlin.coroutines.experimental.intrinsics.*
|
|
||||||
|
|
||||||
class K : JavaClass() {
|
|
||||||
override suspend fun foo(x: Int): String = super.foo(x) + suspendCoroutine { it.resume("K") }
|
|
||||||
}
|
|
||||||
|
|
||||||
fun builder(c: suspend () -> Unit) {
|
|
||||||
c.startCoroutine(EmptyContinuation)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
var result = "fail"
|
|
||||||
|
|
||||||
builder {
|
|
||||||
// Changing the call to 'K().bar(1)' doesn't work because of KT-25036
|
|
||||||
result = K().foo(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
-22
@@ -1,22 +0,0 @@
|
|||||||
// !LANGUAGE: -ReleaseCoroutines
|
|
||||||
// IGNORE_BACKEND: JVM_IR
|
|
||||||
// IGNORE_BACKEND: JS
|
|
||||||
// WITH_RUNTIME
|
|
||||||
// WITH_COROUTINES
|
|
||||||
// DONT_TARGET_EXACT_BACKEND: JS_IR
|
|
||||||
// DONT_TARGET_EXACT_BACKEND: JS_IR_ES6
|
|
||||||
|
|
||||||
import helpers.*
|
|
||||||
import kotlin.coroutines.experimental.*
|
|
||||||
|
|
||||||
val f = run {
|
|
||||||
buildSequence {
|
|
||||||
if (true) {
|
|
||||||
yield("OK")
|
|
||||||
}
|
|
||||||
}.toList()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
return f[0]
|
|
||||||
}
|
|
||||||
-61
@@ -1,61 +0,0 @@
|
|||||||
// !LANGUAGE: -ReleaseCoroutines
|
|
||||||
// IGNORE_BACKEND: JVM_IR
|
|
||||||
// WITH_RUNTIME
|
|
||||||
// WITH_COROUTINES
|
|
||||||
// FILE: main.kt
|
|
||||||
// TARGET_BACKEND: JVM
|
|
||||||
|
|
||||||
import helpers.*
|
|
||||||
import kotlin.coroutines.experimental.*
|
|
||||||
import kotlin.coroutines.experimental.intrinsics.*
|
|
||||||
|
|
||||||
open class A(val v: String) {
|
|
||||||
suspend fun suspendThere(v: String): String = suspendCoroutineUninterceptedOrReturn { x ->
|
|
||||||
x.resume(v)
|
|
||||||
COROUTINE_SUSPENDED
|
|
||||||
}
|
|
||||||
|
|
||||||
open suspend fun suspendHere(): String = suspendThere("O") + suspendThere(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
class B(v: String) : A(v) {
|
|
||||||
override suspend fun suspendHere(): String = super.suspendHere() + suspendThere("56")
|
|
||||||
}
|
|
||||||
|
|
||||||
fun builder(c: suspend A.() -> Unit) {
|
|
||||||
c.startCoroutine(B("K"), EmptyContinuation)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
var result = JavaClass.foo()
|
|
||||||
|
|
||||||
if (result != "OK56") return "fail 1: $result"
|
|
||||||
|
|
||||||
return "OK"
|
|
||||||
}
|
|
||||||
|
|
||||||
// FILE: JavaClass.java
|
|
||||||
import kotlin.coroutines.experimental.*;
|
|
||||||
public class JavaClass {
|
|
||||||
public static String foo() {
|
|
||||||
final String[] res = new String[1];
|
|
||||||
|
|
||||||
new B("K").suspendHere(new Continuation<String>() {
|
|
||||||
@Override
|
|
||||||
public CoroutineContext getContext() {
|
|
||||||
return EmptyCoroutineContext.INSTANCE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void resume(String s) {
|
|
||||||
res[0] = s;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void resumeWithException(Throwable throwable) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return res[0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-40
@@ -1,40 +0,0 @@
|
|||||||
// !LANGUAGE: -ReleaseCoroutines
|
|
||||||
// IGNORE_BACKEND: JVM_IR
|
|
||||||
// TARGET_BACKEND: JVM
|
|
||||||
// WITH_RUNTIME
|
|
||||||
// WITH_COROUTINES
|
|
||||||
|
|
||||||
// FILE: I.kt
|
|
||||||
|
|
||||||
interface I {
|
|
||||||
suspend fun foo(x: Int): String
|
|
||||||
}
|
|
||||||
|
|
||||||
// FILE: JavaClass.java
|
|
||||||
|
|
||||||
public class JavaClass implements I {
|
|
||||||
@Override
|
|
||||||
public Object foo(int x, kotlin.coroutines.experimental.Continuation<? super String> continuation) {
|
|
||||||
continuation.resume("OK");
|
|
||||||
return kotlin.coroutines.experimental.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// FILE: main.kt
|
|
||||||
import helpers.*
|
|
||||||
import kotlin.coroutines.experimental.*
|
|
||||||
import kotlin.coroutines.experimental.intrinsics.*
|
|
||||||
|
|
||||||
fun builder(c: suspend () -> Unit) {
|
|
||||||
c.startCoroutine(EmptyContinuation)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
var result = "fail"
|
|
||||||
|
|
||||||
builder {
|
|
||||||
result = JavaClass().foo(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
-148
@@ -20297,154 +20297,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class Coroutines extends AbstractBlackBoxCodegenTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInCoroutines() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("asyncIteratorNullMerge_1_2.kt")
|
|
||||||
public void testAsyncIteratorNullMerge_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIteratorNullMerge_1_2.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("asyncIteratorToList_1_2.kt")
|
|
||||||
public void testAsyncIteratorToList_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIteratorToList_1_2.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("asyncIterator_1_2.kt")
|
|
||||||
public void testAsyncIterator_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIterator_1_2.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("coroutineToString_1_2.kt")
|
|
||||||
public void testCoroutineToString_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/coroutineToString_1_2.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("createCoroutinesOnManualInstances_1_2.kt")
|
|
||||||
public void testCreateCoroutinesOnManualInstances_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/createCoroutinesOnManualInstances_1_2.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("illegalState_1_2.kt")
|
|
||||||
public void testIllegalState_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/illegalState_1_2.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("suspendCovariantJavaOverrides_1_2.kt")
|
|
||||||
public void testSuspendCovariantJavaOverrides_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendCovariantJavaOverrides_1_2.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("suspendJavaOverrides_1_2.kt")
|
|
||||||
public void testSuspendJavaOverrides_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendJavaOverrides_1_2.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class ControlFlow extends AbstractBlackBoxCodegenTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInControlFlow() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("kt22694_1_2.kt")
|
|
||||||
public void testKt22694_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow/kt22694_1_2.kt");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class FeatureIntersection extends AbstractBlackBoxCodegenTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInFeatureIntersection() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("suspendFunction_1_2.kt")
|
|
||||||
public void testSuspendFunction_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection/suspendFunction_1_2.kt");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class MultiModule extends AbstractBlackBoxCodegenTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInMultiModule() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("inlineWithJava_1_2.kt")
|
|
||||||
public void testInlineWithJava_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule/inlineWithJava_1_2.kt");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class Reflect extends AbstractBlackBoxCodegenTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInReflect() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("isSuspend_1_2.kt")
|
|
||||||
public void testIsSuspend_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect/isSuspend_1_2.kt");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class SuspendFunctionAsCoroutine extends AbstractBlackBoxCodegenTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInSuspendFunctionAsCoroutine() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("ifExpressionInsideCoroutine_1_2.kt")
|
|
||||||
public void testIfExpressionInsideCoroutine_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_2.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("openFunWithJava_1_2.kt")
|
|
||||||
public void testOpenFunWithJava_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine/openFunWithJava_1_2.kt");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/functions")
|
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/functions")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
|||||||
-148
@@ -20297,154 +20297,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class Coroutines extends AbstractLightAnalysisModeTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInCoroutines() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("asyncIteratorNullMerge_1_2.kt")
|
|
||||||
public void testAsyncIteratorNullMerge_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIteratorNullMerge_1_2.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("asyncIteratorToList_1_2.kt")
|
|
||||||
public void testAsyncIteratorToList_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIteratorToList_1_2.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("asyncIterator_1_2.kt")
|
|
||||||
public void testAsyncIterator_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIterator_1_2.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("coroutineToString_1_2.kt")
|
|
||||||
public void testCoroutineToString_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/coroutineToString_1_2.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("createCoroutinesOnManualInstances_1_2.kt")
|
|
||||||
public void testCreateCoroutinesOnManualInstances_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/createCoroutinesOnManualInstances_1_2.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("illegalState_1_2.kt")
|
|
||||||
public void testIllegalState_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/illegalState_1_2.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("suspendCovariantJavaOverrides_1_2.kt")
|
|
||||||
public void testSuspendCovariantJavaOverrides_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendCovariantJavaOverrides_1_2.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("suspendJavaOverrides_1_2.kt")
|
|
||||||
public void testSuspendJavaOverrides_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendJavaOverrides_1_2.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class ControlFlow extends AbstractLightAnalysisModeTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInControlFlow() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("kt22694_1_2.kt")
|
|
||||||
public void testKt22694_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow/kt22694_1_2.kt");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class FeatureIntersection extends AbstractLightAnalysisModeTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInFeatureIntersection() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("suspendFunction_1_2.kt")
|
|
||||||
public void testSuspendFunction_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection/suspendFunction_1_2.kt");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class MultiModule extends AbstractLightAnalysisModeTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInMultiModule() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("inlineWithJava_1_2.kt")
|
|
||||||
public void testInlineWithJava_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule/inlineWithJava_1_2.kt");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class Reflect extends AbstractLightAnalysisModeTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInReflect() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("isSuspend_1_2.kt")
|
|
||||||
public void testIsSuspend_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect/isSuspend_1_2.kt");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class SuspendFunctionAsCoroutine extends AbstractLightAnalysisModeTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInSuspendFunctionAsCoroutine() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("ifExpressionInsideCoroutine_1_2.kt")
|
|
||||||
public void testIfExpressionInsideCoroutine_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_2.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("openFunWithJava_1_2.kt")
|
|
||||||
public void testOpenFunWithJava_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine/openFunWithJava_1_2.kt");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/functions")
|
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/functions")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
|||||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
Generated
-83
@@ -16297,89 +16297,6 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class Coroutines extends AbstractIrJsCodegenBoxES6Test {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInCoroutines() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class ControlFlow extends AbstractIrJsCodegenBoxES6Test {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInControlFlow() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class FeatureIntersection extends AbstractIrJsCodegenBoxES6Test {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInFeatureIntersection() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("suspendFunction_1_2.kt")
|
|
||||||
public void testSuspendFunction_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection/suspendFunction_1_2.kt");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class MultiModule extends AbstractIrJsCodegenBoxES6Test {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInMultiModule() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class Reflect extends AbstractIrJsCodegenBoxES6Test {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInReflect() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class SuspendFunctionAsCoroutine extends AbstractIrJsCodegenBoxES6Test {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInSuspendFunctionAsCoroutine() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/functions")
|
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/functions")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
|||||||
Generated
-83
@@ -16297,89 +16297,6 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class Coroutines extends AbstractIrJsCodegenBoxTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInCoroutines() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class ControlFlow extends AbstractIrJsCodegenBoxTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInControlFlow() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class FeatureIntersection extends AbstractIrJsCodegenBoxTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInFeatureIntersection() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("suspendFunction_1_2.kt")
|
|
||||||
public void testSuspendFunction_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection/suspendFunction_1_2.kt");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class MultiModule extends AbstractIrJsCodegenBoxTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInMultiModule() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class Reflect extends AbstractIrJsCodegenBoxTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInReflect() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class SuspendFunctionAsCoroutine extends AbstractIrJsCodegenBoxTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInSuspendFunctionAsCoroutine() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/functions")
|
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/functions")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
|||||||
Generated
-118
@@ -16362,124 +16362,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class Coroutines extends AbstractJsCodegenBoxTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInCoroutines() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("asyncIteratorNullMerge_1_2.kt")
|
|
||||||
public void testAsyncIteratorNullMerge_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIteratorNullMerge_1_2.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("asyncIteratorToList_1_2.kt")
|
|
||||||
public void testAsyncIteratorToList_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIteratorToList_1_2.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("asyncIterator_1_2.kt")
|
|
||||||
public void testAsyncIterator_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIterator_1_2.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("createCoroutinesOnManualInstances_1_2.kt")
|
|
||||||
public void testCreateCoroutinesOnManualInstances_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/createCoroutinesOnManualInstances_1_2.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class ControlFlow extends AbstractJsCodegenBoxTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInControlFlow() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("kt22694_1_2.kt")
|
|
||||||
public void testKt22694_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow/kt22694_1_2.kt");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class FeatureIntersection extends AbstractJsCodegenBoxTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInFeatureIntersection() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("suspendFunction_1_2.kt")
|
|
||||||
public void testSuspendFunction_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection/suspendFunction_1_2.kt");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class MultiModule extends AbstractJsCodegenBoxTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInMultiModule() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class Reflect extends AbstractJsCodegenBoxTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInReflect() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("isSuspend_1_2.kt")
|
|
||||||
public void testIsSuspend_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect/isSuspend_1_2.kt");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
|
||||||
public static class SuspendFunctionAsCoroutine extends AbstractJsCodegenBoxTest {
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
|
||||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAllFilesPresentInSuspendFunctionAsCoroutine() throws Exception {
|
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("ifExpressionInsideCoroutine_1_2.kt")
|
|
||||||
public void testIfExpressionInsideCoroutine_1_2() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_2.kt");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/functions")
|
@TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/functions")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
|||||||
Reference in New Issue
Block a user