Rename: Add tests for enum entries
#KT-4800 Fixed
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
package test
|
||||
|
||||
enum class D(n: Int) {
|
||||
O: D(0)
|
||||
A: D(1)
|
||||
B: D(2)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package test
|
||||
|
||||
enum class E(n: Int) {
|
||||
O: E(0)
|
||||
A: E(1)
|
||||
B: E(2)
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"type": "KOTLIN_CLASS",
|
||||
"classFQN": "test.E",
|
||||
"newName": "D"
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package test
|
||||
|
||||
enum class E {
|
||||
open fun bar(n: Int): Int = n
|
||||
|
||||
O
|
||||
A {
|
||||
override fun bar(n: Int): Int = n + 1
|
||||
|
||||
}
|
||||
B {
|
||||
override fun bar(n: Int): Int = n + 2
|
||||
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package test
|
||||
|
||||
enum class E {
|
||||
open fun foo(n: Int): Int = n
|
||||
|
||||
O
|
||||
A {
|
||||
override fun foo(n: Int): Int = n + 1
|
||||
|
||||
}
|
||||
B {
|
||||
override fun foo(n: Int): Int = n + 2
|
||||
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"type": "KOTLIN_FUNCTION",
|
||||
"classFQN": "test.E",
|
||||
"oldName": "foo",
|
||||
"newName": "bar"
|
||||
}
|
||||
@@ -162,6 +162,18 @@ public class RenameTestGenerated extends AbstractRenameTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("renameKotlinEnum/renameKotlinEnum.test")
|
||||
public void testRenameKotlinEnum_RenameKotlinEnum() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/refactoring/rename/renameKotlinEnum/renameKotlinEnum.test");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("renameKotlinFunctionInEnum/renameKotlinFunctionInEnum.test")
|
||||
public void testRenameKotlinFunctionInEnum_RenameKotlinFunctionInEnum() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/refactoring/rename/renameKotlinFunctionInEnum/renameKotlinFunctionInEnum.test");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("renameKotlinMethod/javaWrapperForKotlinMethod.test")
|
||||
public void testRenameKotlinMethod_JavaWrapperForKotlinMethod() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/refactoring/rename/renameKotlinMethod/javaWrapperForKotlinMethod.test");
|
||||
|
||||
Reference in New Issue
Block a user