Box inline test for local delegated property

This commit is contained in:
Mikhael Bogdanov
2016-05-06 13:46:56 +03:00
parent 5e933b7acd
commit 6ece2b41d6
3 changed files with 51 additions and 0 deletions
@@ -0,0 +1,21 @@
// FILE: 1.kt
package test
import kotlin.reflect.KProperty
class Delegate {
operator fun getValue(t: Any?, p: KProperty<*>): String = "OK"
}
inline fun test(): String {
val prop: String by Delegate()
return prop
}
// FILE: 2.kt
import test.*
fun box(): String {
return test()
}
@@ -746,6 +746,21 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo
}
}
@TestMetadata("compiler/testData/codegen/boxInline/delegatedProperty")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class DelegatedProperty extends AbstractBlackBoxInlineCodegenTest {
public void testAllFilesPresentInDelegatedProperty() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/delegatedProperty"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("local.kt")
public void testLocal() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/delegatedProperty/local.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/codegen/boxInline/enclosingInfo")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -746,6 +746,21 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi
}
}
@TestMetadata("compiler/testData/codegen/boxInline/delegatedProperty")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class DelegatedProperty extends AbstractCompileKotlinAgainstInlineKotlinTest {
public void testAllFilesPresentInDelegatedProperty() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/delegatedProperty"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("local.kt")
public void testLocal() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/delegatedProperty/local.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/codegen/boxInline/enclosingInfo")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)