Minor. Split tests with buildSequence into LV 1.2 and LV 1.3 versions
This commit is contained in:
@@ -0,0 +1,48 @@
|
|||||||
|
// IGNORE_BACKEND: JS_IR
|
||||||
|
// IGNORE_BACKEND: JVM_IR
|
||||||
|
// WITH_RUNTIME
|
||||||
|
// WITH_COROUTINES
|
||||||
|
// LANGUAGE_VERSION: 1.2
|
||||||
|
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")
|
||||||
|
}
|
||||||
+2
-2
@@ -2,9 +2,9 @@
|
|||||||
// IGNORE_BACKEND: JVM_IR
|
// IGNORE_BACKEND: JVM_IR
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// WITH_COROUTINES
|
// WITH_COROUTINES
|
||||||
// COMMON_COROUTINES_TEST
|
// LANGUAGE_VERSION: 1.3
|
||||||
import helpers.*
|
import helpers.*
|
||||||
import COROUTINES_PACKAGE.*
|
import kotlin.coroutines.*
|
||||||
|
|
||||||
enum class Foo(vararg expected: String) {
|
enum class Foo(vararg expected: String) {
|
||||||
A("start", "A", "end"),
|
A("start", "A", "end"),
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
// IGNORE_BACKEND: JS_IR
|
||||||
|
// IGNORE_BACKEND: JVM_IR
|
||||||
|
// WITH_RUNTIME
|
||||||
|
// WITH_COROUTINES
|
||||||
|
// LANGUAGE_VERSION: 1.2
|
||||||
|
import helpers.*
|
||||||
|
import kotlin.coroutines.experimental.*
|
||||||
|
|
||||||
|
val f = run {
|
||||||
|
buildSequence {
|
||||||
|
if (true) {
|
||||||
|
yield("OK")
|
||||||
|
}
|
||||||
|
}.toList()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
return f[0]
|
||||||
|
}
|
||||||
+2
-2
@@ -2,9 +2,9 @@
|
|||||||
// IGNORE_BACKEND: JVM_IR
|
// IGNORE_BACKEND: JVM_IR
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// WITH_COROUTINES
|
// WITH_COROUTINES
|
||||||
// COMMON_COROUTINES_TEST
|
// LANGUAGE_VERSION: 1.3
|
||||||
import helpers.*
|
import helpers.*
|
||||||
import COROUTINES_PACKAGE.*
|
import kotlin.coroutines.*
|
||||||
|
|
||||||
val f = run {
|
val f = run {
|
||||||
sequence {
|
sequence {
|
||||||
+8
-8
@@ -6343,14 +6343,14 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt", "kotlin.coroutines");
|
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt", "kotlin.coroutines");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("kt22694.kt")
|
@TestMetadata("kt22694_1_2.kt")
|
||||||
public void testKt22694_1_2() throws Exception {
|
public void testKt22694_1_2() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/kt22694.kt", "kotlin.coroutines.experimental");
|
runTest("compiler/testData/codegen/box/coroutines/controlFlow/kt22694_1_2.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("kt22694.kt")
|
@TestMetadata("kt22694_1_3.kt")
|
||||||
public void testKt22694_1_3() throws Exception {
|
public void testKt22694_1_3() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/kt22694.kt", "kotlin.coroutines");
|
runTest("compiler/testData/codegen/box/coroutines/controlFlow/kt22694_1_3.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("labeledWhile.kt")
|
@TestMetadata("labeledWhile.kt")
|
||||||
@@ -7554,14 +7554,14 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt", "kotlin.coroutines");
|
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt", "kotlin.coroutines");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("ifExpressionInsideCoroutine.kt")
|
@TestMetadata("ifExpressionInsideCoroutine_1_2.kt")
|
||||||
public void testIfExpressionInsideCoroutine_1_2() throws Exception {
|
public void testIfExpressionInsideCoroutine_1_2() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt", "kotlin.coroutines.experimental");
|
runTest("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_2.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("ifExpressionInsideCoroutine.kt")
|
@TestMetadata("ifExpressionInsideCoroutine_1_3.kt")
|
||||||
public void testIfExpressionInsideCoroutine_1_3() throws Exception {
|
public void testIfExpressionInsideCoroutine_1_3() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt", "kotlin.coroutines");
|
runTest("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_3.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("inlineTwoReceivers.kt")
|
@TestMetadata("inlineTwoReceivers.kt")
|
||||||
|
|||||||
+8
-8
@@ -6343,14 +6343,14 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt", "kotlin.coroutines");
|
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt", "kotlin.coroutines");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("kt22694.kt")
|
@TestMetadata("kt22694_1_2.kt")
|
||||||
public void testKt22694_1_2() throws Exception {
|
public void testKt22694_1_2() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/kt22694.kt", "kotlin.coroutines.experimental");
|
runTest("compiler/testData/codegen/box/coroutines/controlFlow/kt22694_1_2.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("kt22694.kt")
|
@TestMetadata("kt22694_1_3.kt")
|
||||||
public void testKt22694_1_3() throws Exception {
|
public void testKt22694_1_3() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/kt22694.kt", "kotlin.coroutines");
|
runTest("compiler/testData/codegen/box/coroutines/controlFlow/kt22694_1_3.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("labeledWhile.kt")
|
@TestMetadata("labeledWhile.kt")
|
||||||
@@ -7554,14 +7554,14 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt", "kotlin.coroutines");
|
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt", "kotlin.coroutines");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("ifExpressionInsideCoroutine.kt")
|
@TestMetadata("ifExpressionInsideCoroutine_1_2.kt")
|
||||||
public void testIfExpressionInsideCoroutine_1_2() throws Exception {
|
public void testIfExpressionInsideCoroutine_1_2() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt", "kotlin.coroutines.experimental");
|
runTest("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_2.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("ifExpressionInsideCoroutine.kt")
|
@TestMetadata("ifExpressionInsideCoroutine_1_3.kt")
|
||||||
public void testIfExpressionInsideCoroutine_1_3() throws Exception {
|
public void testIfExpressionInsideCoroutine_1_3() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt", "kotlin.coroutines");
|
runTest("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_3.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("inlineTwoReceivers.kt")
|
@TestMetadata("inlineTwoReceivers.kt")
|
||||||
|
|||||||
+8
-8
@@ -6343,14 +6343,14 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt", "kotlin.coroutines");
|
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt", "kotlin.coroutines");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("kt22694.kt")
|
@TestMetadata("kt22694_1_2.kt")
|
||||||
public void testKt22694_1_2() throws Exception {
|
public void testKt22694_1_2() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/kt22694.kt", "kotlin.coroutines.experimental");
|
runTest("compiler/testData/codegen/box/coroutines/controlFlow/kt22694_1_2.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("kt22694.kt")
|
@TestMetadata("kt22694_1_3.kt")
|
||||||
public void testKt22694_1_3() throws Exception {
|
public void testKt22694_1_3() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/kt22694.kt", "kotlin.coroutines");
|
runTest("compiler/testData/codegen/box/coroutines/controlFlow/kt22694_1_3.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("labeledWhile.kt")
|
@TestMetadata("labeledWhile.kt")
|
||||||
@@ -7554,14 +7554,14 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt", "kotlin.coroutines");
|
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt", "kotlin.coroutines");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("ifExpressionInsideCoroutine.kt")
|
@TestMetadata("ifExpressionInsideCoroutine_1_2.kt")
|
||||||
public void testIfExpressionInsideCoroutine_1_2() throws Exception {
|
public void testIfExpressionInsideCoroutine_1_2() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt", "kotlin.coroutines.experimental");
|
runTest("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_2.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("ifExpressionInsideCoroutine.kt")
|
@TestMetadata("ifExpressionInsideCoroutine_1_3.kt")
|
||||||
public void testIfExpressionInsideCoroutine_1_3() throws Exception {
|
public void testIfExpressionInsideCoroutine_1_3() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt", "kotlin.coroutines");
|
runTest("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_3.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("inlineTwoReceivers.kt")
|
@TestMetadata("inlineTwoReceivers.kt")
|
||||||
|
|||||||
+14
-4
@@ -5573,9 +5573,14 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
|||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt", "kotlin.coroutines");
|
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt", "kotlin.coroutines");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("kt22694.kt")
|
@TestMetadata("kt22694_1_2.kt")
|
||||||
|
public void testKt22694_1_2() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/coroutines/controlFlow/kt22694_1_2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt22694_1_3.kt")
|
||||||
public void testKt22694_1_3() throws Exception {
|
public void testKt22694_1_3() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/kt22694.kt", "kotlin.coroutines");
|
runTest("compiler/testData/codegen/box/coroutines/controlFlow/kt22694_1_3.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("labeledWhile.kt")
|
@TestMetadata("labeledWhile.kt")
|
||||||
@@ -6349,9 +6354,14 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
|||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt", "kotlin.coroutines");
|
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt", "kotlin.coroutines");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("ifExpressionInsideCoroutine.kt")
|
@TestMetadata("ifExpressionInsideCoroutine_1_2.kt")
|
||||||
|
public void testIfExpressionInsideCoroutine_1_2() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("ifExpressionInsideCoroutine_1_3.kt")
|
||||||
public void testIfExpressionInsideCoroutine_1_3() throws Exception {
|
public void testIfExpressionInsideCoroutine_1_3() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt", "kotlin.coroutines");
|
runTest("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_3.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("inlineTwoReceivers.kt")
|
@TestMetadata("inlineTwoReceivers.kt")
|
||||||
|
|||||||
+8
-8
@@ -6053,14 +6053,14 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
|||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt", "kotlin.coroutines");
|
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt", "kotlin.coroutines");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("kt22694.kt")
|
@TestMetadata("kt22694_1_2.kt")
|
||||||
public void testKt22694_1_2() throws Exception {
|
public void testKt22694_1_2() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/kt22694.kt", "kotlin.coroutines.experimental");
|
runTest("compiler/testData/codegen/box/coroutines/controlFlow/kt22694_1_2.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("kt22694.kt")
|
@TestMetadata("kt22694_1_3.kt")
|
||||||
public void testKt22694_1_3() throws Exception {
|
public void testKt22694_1_3() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/controlFlow/kt22694.kt", "kotlin.coroutines");
|
runTest("compiler/testData/codegen/box/coroutines/controlFlow/kt22694_1_3.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("labeledWhile.kt")
|
@TestMetadata("labeledWhile.kt")
|
||||||
@@ -7234,14 +7234,14 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
|||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt", "kotlin.coroutines");
|
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt", "kotlin.coroutines");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("ifExpressionInsideCoroutine.kt")
|
@TestMetadata("ifExpressionInsideCoroutine_1_2.kt")
|
||||||
public void testIfExpressionInsideCoroutine_1_2() throws Exception {
|
public void testIfExpressionInsideCoroutine_1_2() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt", "kotlin.coroutines.experimental");
|
runTest("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_2.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("ifExpressionInsideCoroutine.kt")
|
@TestMetadata("ifExpressionInsideCoroutine_1_3.kt")
|
||||||
public void testIfExpressionInsideCoroutine_1_3() throws Exception {
|
public void testIfExpressionInsideCoroutine_1_3() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine.kt", "kotlin.coroutines");
|
runTest("compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_3.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("inlineTwoReceivers.kt")
|
@TestMetadata("inlineTwoReceivers.kt")
|
||||||
|
|||||||
Reference in New Issue
Block a user