mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-03-10 08:31:29 +00:00
[JS IR] Add test with fail with srrayOf in suspend
This commit is contained in:
@@ -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 {
|
||||
|
||||
26
compiler/testData/codegen/box/coroutines/suspendConstructorCallArrayOf.kt
vendored
Normal file
26
compiler/testData/codegen/box/coroutines/suspendConstructorCallArrayOf.kt
vendored
Normal 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"
|
||||
}
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user