[JS IR] Add test with fail with srrayOf in suspend

This commit is contained in:
Ilya Goncharov
2021-08-19 19:05:35 +03:00
parent d33b70af1a
commit af7d197887
8 changed files with 64 additions and 0 deletions

View File

@@ -9728,6 +9728,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/coroutines/suspendCallsInArguments.kt");
}
@Test
@TestMetadata("suspendConstructorCallArrayOf.kt")
public void testSuspendConstructorCallArrayOf() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/suspendConstructorCallArrayOf.kt");
}
@Test
@TestMetadata("suspendCoroutineFromStateMachine.kt")
public void testSuspendCoroutineFromStateMachine() throws Exception {

View File

@@ -0,0 +1,26 @@
// WITH_RUNTIME
import kotlin.coroutines.*
suspend fun foo() {
Foo(
arrayOf(
bar()
)
)
}
suspend fun bar() = 5
var failure = false
class Foo(blobParts: Array<Int>) {
init {
if (blobParts[0] != 5) failure = true
}
}
fun box(): String {
::foo.startCoroutine(Continuation(EmptyCoroutineContext) { it.getOrThrow() })
return if (!failure) "OK" else "FAILURE"
}

View File

@@ -9626,6 +9626,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/coroutines/suspendCallsInArguments.kt");
}
@Test
@TestMetadata("suspendConstructorCallArrayOf.kt")
public void testSuspendConstructorCallArrayOf() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/suspendConstructorCallArrayOf.kt");
}
@Test
@TestMetadata("suspendCoroutineFromStateMachine.kt")
public void testSuspendCoroutineFromStateMachine() throws Exception {

View File

@@ -9728,6 +9728,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/coroutines/suspendCallsInArguments.kt");
}
@Test
@TestMetadata("suspendConstructorCallArrayOf.kt")
public void testSuspendConstructorCallArrayOf() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/suspendConstructorCallArrayOf.kt");
}
@Test
@TestMetadata("suspendCoroutineFromStateMachine.kt")
public void testSuspendCoroutineFromStateMachine() throws Exception {

View File

@@ -7535,6 +7535,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/coroutines/suspendCallsInArguments.kt");
}
@TestMetadata("suspendConstructorCallArrayOf.kt")
public void testSuspendConstructorCallArrayOf() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/suspendConstructorCallArrayOf.kt");
}
@TestMetadata("suspendCoroutineFromStateMachine.kt")
public void testSuspendCoroutineFromStateMachine() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt");

View File

@@ -6699,6 +6699,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
runTest("compiler/testData/codegen/box/coroutines/suspendCallsInArguments.kt");
}
@TestMetadata("suspendConstructorCallArrayOf.kt")
public void testSuspendConstructorCallArrayOf() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/suspendConstructorCallArrayOf.kt");
}
@TestMetadata("suspendCoroutineFromStateMachine.kt")
public void testSuspendCoroutineFromStateMachine() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt");

View File

@@ -6105,6 +6105,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/coroutines/suspendCallsInArguments.kt");
}
@TestMetadata("suspendConstructorCallArrayOf.kt")
public void testSuspendConstructorCallArrayOf() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/suspendConstructorCallArrayOf.kt");
}
@TestMetadata("suspendCoroutineFromStateMachine.kt")
public void testSuspendCoroutineFromStateMachine() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt");

View File

@@ -6105,6 +6105,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/coroutines/suspendCallsInArguments.kt");
}
@TestMetadata("suspendConstructorCallArrayOf.kt")
public void testSuspendConstructorCallArrayOf() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/suspendConstructorCallArrayOf.kt");
}
@TestMetadata("suspendCoroutineFromStateMachine.kt")
public void testSuspendCoroutineFromStateMachine() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt");