test(KT-47096): add tests for the uncovered behavior.
This commit is contained in:
+6
@@ -43934,6 +43934,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/vararg/spreadCopiesArray.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("useSuspendFunResultAsVararg.kt")
|
||||
public void testUseSuspendFunResultAsVararg() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/vararg/useSuspendFunResultAsVararg.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("varargInFunParam.kt")
|
||||
public void testVarargInFunParam() throws Exception {
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
|
||||
import helpers.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
class TodoItem(var value: String, var completed: Boolean) {
|
||||
override fun toString(): String {
|
||||
return "TodoItem(value='$value', completed=$completed)"
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun getFromApi(): TodoItem {
|
||||
return TodoItem("Test", false)
|
||||
}
|
||||
|
||||
fun emulateLog(vararg strings: String): String {
|
||||
return strings[0]
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var stringifiedResult = ""
|
||||
|
||||
builder {
|
||||
stringifiedResult = emulateLog("Result: " + getFromApi())
|
||||
}
|
||||
|
||||
if (stringifiedResult != "Result: TodoItem(value='Test', completed=false)") {
|
||||
return "Failed: Unexpected result ($stringifiedResult)"
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
+6
@@ -43772,6 +43772,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/vararg/spreadCopiesArray.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("useSuspendFunResultAsVararg.kt")
|
||||
public void testUseSuspendFunResultAsVararg() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/vararg/useSuspendFunResultAsVararg.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("varargInFunParam.kt")
|
||||
public void testVarargInFunParam() throws Exception {
|
||||
|
||||
+6
@@ -43934,6 +43934,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/vararg/spreadCopiesArray.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("useSuspendFunResultAsVararg.kt")
|
||||
public void testUseSuspendFunResultAsVararg() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/vararg/useSuspendFunResultAsVararg.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("varargInFunParam.kt")
|
||||
public void testVarargInFunParam() throws Exception {
|
||||
|
||||
+5
@@ -35355,6 +35355,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/vararg/spreadCopiesArray.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("useSuspendFunResultAsVararg.kt")
|
||||
public void testUseSuspendFunResultAsVararg() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/vararg/useSuspendFunResultAsVararg.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("varargInFunParam.kt")
|
||||
public void testVarargInFunParam() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/vararg/varargInFunParam.kt");
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
Generated
+5
@@ -29325,6 +29325,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
runTest("compiler/testData/codegen/box/vararg/spreadCopiesArray.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("useSuspendFunResultAsVararg.kt")
|
||||
public void testUseSuspendFunResultAsVararg() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/vararg/useSuspendFunResultAsVararg.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("varargInFunParam.kt")
|
||||
public void testVarargInFunParam() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/vararg/varargInFunParam.kt");
|
||||
|
||||
Generated
+5
@@ -28731,6 +28731,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/vararg/spreadCopiesArray.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("useSuspendFunResultAsVararg.kt")
|
||||
public void testUseSuspendFunResultAsVararg() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/vararg/useSuspendFunResultAsVararg.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("varargInFunParam.kt")
|
||||
public void testVarargInFunParam() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/vararg/varargInFunParam.kt");
|
||||
|
||||
Generated
+5
@@ -28646,6 +28646,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/vararg/spreadCopiesArray.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("useSuspendFunResultAsVararg.kt")
|
||||
public void testUseSuspendFunResultAsVararg() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/vararg/useSuspendFunResultAsVararg.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("varargInFunParam.kt")
|
||||
public void testVarargInFunParam() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/vararg/varargInFunParam.kt");
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java
Generated
+5
@@ -25067,6 +25067,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
runTest("compiler/testData/codegen/box/vararg/spreadCopiesArray.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("useSuspendFunResultAsVararg.kt")
|
||||
public void testUseSuspendFunResultAsVararg() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/vararg/useSuspendFunResultAsVararg.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("varargInFunParam.kt")
|
||||
public void testVarargInFunParam() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/vararg/varargInFunParam.kt");
|
||||
|
||||
Reference in New Issue
Block a user