KT-44839 [Sealed interfaces]: restore move-tests for lang-version < 15
This commit restores tests removed in 690fb47c.
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
|||||||
|
// COMPILER_ARGUMENTS: -XXLanguage:-AllowSealedInheritorsInDifferentFilesOfSamePackage
|
||||||
|
|
||||||
|
package source
|
||||||
|
|
||||||
|
import target.Expr
|
||||||
|
|
||||||
|
data class Const(val number: Double) : Expr()
|
||||||
|
data class Sum(val e1: Expr, val e2: Expr) : Expr()
|
||||||
|
object NotANumber : Expr()
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
package target
|
||||||
|
|
||||||
|
sealed class Expr
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
// COMPILER_ARGUMENTS: -XXLanguage:-AllowSealedInheritorsInDifferentFilesOfSamePackage
|
||||||
|
|
||||||
|
package source
|
||||||
|
|
||||||
|
sealed class <caret>Expr
|
||||||
|
data class Const(val number: Double) : Expr()
|
||||||
|
data class Sum(val e1: Expr, val e2: Expr) : Expr()
|
||||||
|
object NotANumber : Expr()
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
Sealed class 'Expr' must be moved with all its subclasses
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"customCompilerOpts": "COMPILER_ARGUMENTS: -XXLanguage:-AllowSealedInheritorsInDifferentFilesOfSamePackage",
|
||||||
|
"mainFile": "source/Foo.kt",
|
||||||
|
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
|
||||||
|
"targetPackage": "target"
|
||||||
|
}
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
package source
|
||||||
|
|
||||||
|
sealed class Expr
|
||||||
|
data class Sum(val e1: Expr, val e2: Expr) : Expr()
|
||||||
|
object NotANumber : Expr()
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
package target
|
||||||
|
|
||||||
|
import source.Expr
|
||||||
|
|
||||||
|
data class Const(val number: Double) : Expr()
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
package source
|
||||||
|
|
||||||
|
sealed class Expr
|
||||||
|
data class <caret>Const(val number: Double) : Expr()
|
||||||
|
data class Sum(val e1: Expr, val e2: Expr) : Expr()
|
||||||
|
object NotANumber : Expr()
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
Class 'Expr' must be moved with sealed parent class and all its subclasses
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"customCompilerOpts": "COMPILER_ARGUMENTS: -XXLanguage:-AllowSealedInheritorsInDifferentFilesOfSamePackage",
|
||||||
|
"mainFile": "source/Foo.kt",
|
||||||
|
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
|
||||||
|
"targetPackage": "target"
|
||||||
|
}
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
package bar
|
||||||
|
|
||||||
|
public sealed class SealedClass {
|
||||||
|
public class Impl1 : SealedClass() {}
|
||||||
|
}
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
package foo
|
||||||
|
|
||||||
|
import bar.SealedClass
|
||||||
|
|
||||||
|
val v = SealedClass::Impl1
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
package foo
|
||||||
|
|
||||||
|
import bar.SealedClass
|
||||||
|
|
||||||
|
public class Impl2 : SealedClass() {}
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
package foo
|
||||||
|
|
||||||
|
val v = SealedClass::Impl1
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
package foo
|
||||||
|
|
||||||
|
public sealed class <caret>SealedClass {
|
||||||
|
public class Impl1 : SealedClass() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Impl2 : SealedClass() {}
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
Sealed class 'SealedClass' must be moved with all its subclasses
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"customCompilerOpts": "COMPILER_ARGUMENTS: -XXLanguage:-AllowSealedInheritorsInDifferentFilesOfSamePackage",
|
||||||
|
"mainFile": "foo/SealedClass.kt",
|
||||||
|
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
|
||||||
|
"targetPackage": "bar"
|
||||||
|
}
|
||||||
+15
@@ -644,6 +644,16 @@ public class MoveTestGenerated extends AbstractMoveTest {
|
|||||||
runTest("idea/testData/refactoring/move/kotlin/moveTopLevelDeclarations/misc/sealedClassWithAllSubclasses/sealedClassWithAllSubclasses.test");
|
runTest("idea/testData/refactoring/move/kotlin/moveTopLevelDeclarations/misc/sealedClassWithAllSubclasses/sealedClassWithAllSubclasses.test");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kotlin/moveTopLevelDeclarations/misc/sealedClassWithSkippedSubclasses/sealedClassWithSkippedSubclasses.test")
|
||||||
|
public void testKotlin_moveTopLevelDeclarations_misc_sealedClassWithSkippedSubclasses_SealedClassWithSkippedSubclasses() throws Exception {
|
||||||
|
runTest("idea/testData/refactoring/move/kotlin/moveTopLevelDeclarations/misc/sealedClassWithSkippedSubclasses/sealedClassWithSkippedSubclasses.test");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kotlin/moveTopLevelDeclarations/misc/sealedSubclassWithSkippedRoot/sealedSubclassWithSkippedRoot.test")
|
||||||
|
public void testKotlin_moveTopLevelDeclarations_misc_sealedSubclassWithSkippedRoot_SealedSubclassWithSkippedRoot() throws Exception {
|
||||||
|
runTest("idea/testData/refactoring/move/kotlin/moveTopLevelDeclarations/misc/sealedSubclassWithSkippedRoot/sealedSubclassWithSkippedRoot.test");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kotlin/moveTopLevelDeclarations/misc/selfReferences/selfReferences.test")
|
@TestMetadata("kotlin/moveTopLevelDeclarations/misc/selfReferences/selfReferences.test")
|
||||||
public void testKotlin_moveTopLevelDeclarations_misc_selfReferences_SelfReferences() throws Exception {
|
public void testKotlin_moveTopLevelDeclarations_misc_selfReferences_SelfReferences() throws Exception {
|
||||||
runTest("idea/testData/refactoring/move/kotlin/moveTopLevelDeclarations/misc/selfReferences/selfReferences.test");
|
runTest("idea/testData/refactoring/move/kotlin/moveTopLevelDeclarations/misc/selfReferences/selfReferences.test");
|
||||||
@@ -769,6 +779,11 @@ public class MoveTestGenerated extends AbstractMoveTest {
|
|||||||
runTest("idea/testData/refactoring/move/kotlin/moveTopLevelDeclarations/movePropertyToPackage/movePropertyToPackage.test");
|
runTest("idea/testData/refactoring/move/kotlin/moveTopLevelDeclarations/movePropertyToPackage/movePropertyToPackage.test");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kotlin/moveTopLevelDeclarations/moveSealedClassWithImplsToAnotherPackage/moveSealedClassWithNestedImplsToAnotherPackage.test")
|
||||||
|
public void testKotlin_moveTopLevelDeclarations_moveSealedClassWithImplsToAnotherPackage_MoveSealedClassWithNestedImplsToAnotherPackage() throws Exception {
|
||||||
|
runTest("idea/testData/refactoring/move/kotlin/moveTopLevelDeclarations/moveSealedClassWithImplsToAnotherPackage/moveSealedClassWithNestedImplsToAnotherPackage.test");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kotlin/moveTopLevelDeclarations/moveSealedClassWithNestedImplsToAnotherPackage/moveSealedClassWithNestedImplsToAnotherPackage.test")
|
@TestMetadata("kotlin/moveTopLevelDeclarations/moveSealedClassWithNestedImplsToAnotherPackage/moveSealedClassWithNestedImplsToAnotherPackage.test")
|
||||||
public void testKotlin_moveTopLevelDeclarations_moveSealedClassWithNestedImplsToAnotherPackage_MoveSealedClassWithNestedImplsToAnotherPackage() throws Exception {
|
public void testKotlin_moveTopLevelDeclarations_moveSealedClassWithNestedImplsToAnotherPackage_MoveSealedClassWithNestedImplsToAnotherPackage() throws Exception {
|
||||||
runTest("idea/testData/refactoring/move/kotlin/moveTopLevelDeclarations/moveSealedClassWithNestedImplsToAnotherPackage/moveSealedClassWithNestedImplsToAnotherPackage.test");
|
runTest("idea/testData/refactoring/move/kotlin/moveTopLevelDeclarations/moveSealedClassWithNestedImplsToAnotherPackage/moveSealedClassWithNestedImplsToAnotherPackage.test");
|
||||||
|
|||||||
Reference in New Issue
Block a user