Rename: add test for overridden method renaming in generic class

#KT-26047 Fixed
This commit is contained in:
Toshiaki Kameyama
2019-09-13 01:14:59 +09:00
committed by igoriakovlev
parent ff76ba52d8
commit cb1c0344b8
5 changed files with 46 additions and 0 deletions
@@ -0,0 +1,12 @@
package test
open class A<T> {
open fun bar() {
}
}
class B<T> : A<T>() {
override fun bar() {
super.bar()
}
}
@@ -0,0 +1,12 @@
package test
open class A<T> {
open fun foo() {
}
}
class B<T> : A<T>() {
override fun foo() {
super.foo()
}
}
@@ -0,0 +1,6 @@
{
"type": "KOTLIN_FUNCTION",
"classId": "test/A",
"oldName": "foo",
"newName": "bar"
}
@@ -0,0 +1,6 @@
{
"type": "KOTLIN_FUNCTION",
"classId": "test/B",
"oldName": "foo",
"newName": "bar"
}
@@ -813,6 +813,16 @@ public class RenameTestGenerated extends AbstractRenameTest {
runTest("idea/testData/refactoring/rename/renameKotlinFunctionInEnum/renameKotlinFunctionInEnumFromSubclass.test");
}
@TestMetadata("renameKotlinFunctionInGenericClass/renameKotlinFunctionInGenericClass.test")
public void testRenameKotlinFunctionInGenericClass_RenameKotlinFunctionInGenericClass() throws Exception {
runTest("idea/testData/refactoring/rename/renameKotlinFunctionInGenericClass/renameKotlinFunctionInGenericClass.test");
}
@TestMetadata("renameKotlinFunctionInGenericClass/renameKotlinFunctionInGenericClassFromSubclass.test")
public void testRenameKotlinFunctionInGenericClass_RenameKotlinFunctionInGenericClassFromSubclass() throws Exception {
runTest("idea/testData/refactoring/rename/renameKotlinFunctionInGenericClass/renameKotlinFunctionInGenericClassFromSubclass.test");
}
@TestMetadata("renameKotlinFunctionParameterWithByNameUsages/renameKotlinFunctionParameterWithByNameUsages.test")
public void testRenameKotlinFunctionParameterWithByNameUsages_RenameKotlinFunctionParameterWithByNameUsages() throws Exception {
runTest("idea/testData/refactoring/rename/renameKotlinFunctionParameterWithByNameUsages/renameKotlinFunctionParameterWithByNameUsages.test");