Add test case to check delegation of suspend method

This commit is contained in:
Roman Artemev
2018-05-21 00:11:54 +03:00
committed by Roman Artemev
parent f826a253e3
commit 8862b26bbd
5 changed files with 73 additions and 0 deletions
@@ -0,0 +1,31 @@
// WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.*
import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.*
var result = "fail"
interface SuspendInterface {
suspend fun foo(v: String)
}
class Delegate : SuspendInterface {
override suspend fun foo(v: String) {
result = v
}
}
class Decorator(parent: SuspendInterface) : SuspendInterface by parent
fun execute(c: suspend () -> Unit) = c.startCoroutine(EmptyContinuation)
fun box(): String {
execute {
Decorator(Delegate()).foo("OK")
}
return result
}
@@ -5399,6 +5399,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("delegatedSuspendMember.kt")
public void testDelegatedSuspendMember_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental");
}
@TestMetadata("delegatedSuspendMember.kt")
public void testDelegatedSuspendMember_1_3() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("dispatchResume.kt")
public void testDispatchResume_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/dispatchResume.kt");
@@ -5399,6 +5399,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("delegatedSuspendMember.kt")
public void testDelegatedSuspendMember_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental");
}
@TestMetadata("delegatedSuspendMember.kt")
public void testDelegatedSuspendMember_1_3() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("dispatchResume.kt")
public void testDispatchResume_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/dispatchResume.kt");
@@ -5399,6 +5399,18 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("delegatedSuspendMember.kt")
public void testDelegatedSuspendMember_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental");
}
@TestMetadata("delegatedSuspendMember.kt")
public void testDelegatedSuspendMember_1_3() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("dispatchResume.kt")
public void testDispatchResume_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/dispatchResume.kt");
@@ -5067,6 +5067,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental");
}
@TestMetadata("delegatedSuspendMember.kt")
public void testDelegatedSuspendMember_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental");
}
@TestMetadata("dispatchResume.kt")
public void testDispatchResume_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/dispatchResume.kt");