add test for visibility of setter for delegated property (KT-5957)
This commit is contained in:
committed by
Andrey Breslav
parent
e9266481c5
commit
b4eb3e0f43
@@ -0,0 +1,16 @@
|
|||||||
|
class MyClass() {
|
||||||
|
public var x: Int by Delegate()
|
||||||
|
private set
|
||||||
|
}
|
||||||
|
|
||||||
|
class Delegate {
|
||||||
|
fun get(t: Any?, p: PropertyMetadata): Int {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fun set(t: Any?, p: PropertyMetadata, i: Int) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TESTED_OBJECT_KIND: function
|
||||||
|
// TESTED_OBJECTS: MyClass, setX
|
||||||
|
// FLAGS: ACC_FINAL, ACC_PRIVATE
|
||||||
@@ -32,6 +32,7 @@ import java.util.regex.Pattern;
|
|||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@InnerTestClasses({
|
@InnerTestClasses({
|
||||||
WriteFlagsTestGenerated.Class.class,
|
WriteFlagsTestGenerated.Class.class,
|
||||||
|
WriteFlagsTestGenerated.DelegatedProperty.class,
|
||||||
WriteFlagsTestGenerated.Function.class,
|
WriteFlagsTestGenerated.Function.class,
|
||||||
WriteFlagsTestGenerated.InnerClass.class,
|
WriteFlagsTestGenerated.InnerClass.class,
|
||||||
WriteFlagsTestGenerated.Property.class,
|
WriteFlagsTestGenerated.Property.class,
|
||||||
@@ -319,6 +320,33 @@ public class WriteFlagsTestGenerated extends AbstractWriteFlagsTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("compiler/testData/writeFlags/delegatedProperty")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@InnerTestClasses({
|
||||||
|
DelegatedProperty.Visibility.class,
|
||||||
|
})
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class DelegatedProperty extends AbstractWriteFlagsTest {
|
||||||
|
public void testAllFilesPresentInDelegatedProperty() throws Exception {
|
||||||
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/writeFlags/delegatedProperty"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("compiler/testData/writeFlags/delegatedProperty/visibility")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class Visibility extends AbstractWriteFlagsTest {
|
||||||
|
public void testAllFilesPresentInVisibility() throws Exception {
|
||||||
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/writeFlags/delegatedProperty/visibility"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("privateSet.kt")
|
||||||
|
public void testPrivateSet() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/writeFlags/delegatedProperty/visibility/privateSet.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/writeFlags/function")
|
@TestMetadata("compiler/testData/writeFlags/function")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@InnerTestClasses({
|
@InnerTestClasses({
|
||||||
|
|||||||
Reference in New Issue
Block a user