KT-44839 [Sealed interfaces]: restore move-tests for lang-version < 15

This commit restores tests removed in 690fb47c.
This commit is contained in:
Andrei Klunnyi
2021-02-11 16:39:30 +01:00
committed by Space
parent eb0c73fd5e
commit 53a7dc1126
22 changed files with 97 additions and 0 deletions
@@ -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()
@@ -0,0 +1,3 @@
package target
sealed class Expr
@@ -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()
@@ -0,0 +1 @@
Sealed class 'Expr' must be moved with all its subclasses
@@ -0,0 +1,6 @@
{
"customCompilerOpts": "COMPILER_ARGUMENTS: -XXLanguage:-AllowSealedInheritorsInDifferentFilesOfSamePackage",
"mainFile": "source/Foo.kt",
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
"targetPackage": "target"
}
@@ -0,0 +1,5 @@
package source
sealed class Expr
data class Sum(val e1: Expr, val e2: Expr) : Expr()
object NotANumber : Expr()
@@ -0,0 +1,5 @@
package target
import source.Expr
data class Const(val number: Double) : Expr()
@@ -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()
@@ -0,0 +1 @@
Class 'Expr' must be moved with sealed parent class and all its subclasses
@@ -0,0 +1,6 @@
{
"customCompilerOpts": "COMPILER_ARGUMENTS: -XXLanguage:-AllowSealedInheritorsInDifferentFilesOfSamePackage",
"mainFile": "source/Foo.kt",
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
"targetPackage": "target"
}
@@ -0,0 +1,5 @@
package bar
public sealed class SealedClass {
public class Impl1 : SealedClass() {}
}
@@ -0,0 +1,5 @@
package foo
import bar.SealedClass
val v = SealedClass::Impl1
@@ -0,0 +1,5 @@
package foo
import bar.SealedClass
public class Impl2 : SealedClass() {}
@@ -0,0 +1,3 @@
package foo
val v = SealedClass::Impl1
@@ -0,0 +1,7 @@
package foo
public sealed class <caret>SealedClass {
public class Impl1 : SealedClass() {}
}
public class Impl2 : SealedClass() {}
@@ -0,0 +1 @@
Sealed class 'SealedClass' must be moved with all its subclasses
@@ -0,0 +1,6 @@
{
"customCompilerOpts": "COMPILER_ARGUMENTS: -XXLanguage:-AllowSealedInheritorsInDifferentFilesOfSamePackage",
"mainFile": "foo/SealedClass.kt",
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
"targetPackage": "bar"
}
@@ -644,6 +644,16 @@ public class MoveTestGenerated extends AbstractMoveTest {
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")
public void testKotlin_moveTopLevelDeclarations_misc_selfReferences_SelfReferences() throws Exception {
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");
}
@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")
public void testKotlin_moveTopLevelDeclarations_moveSealedClassWithNestedImplsToAnotherPackage_MoveSealedClassWithNestedImplsToAnotherPackage() throws Exception {
runTest("idea/testData/refactoring/move/kotlin/moveTopLevelDeclarations/moveSealedClassWithNestedImplsToAnotherPackage/moveSealedClassWithNestedImplsToAnotherPackage.test");