test(KT-47096): add tests for the uncovered behavior.

This commit is contained in:
Artem Kobzar
2021-10-14 14:57:35 +00:00
committed by Space
parent 50ca86838f
commit 99688e5c80
9 changed files with 79 additions and 0 deletions
@@ -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"
}
@@ -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 {
@@ -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 {
@@ -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");
@@ -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");
@@ -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");
@@ -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");
@@ -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");