Restored lost tests

This commit is contained in:
Valentin Kipyatkov
2016-05-05 11:51:57 +03:00
parent b6301e819a
commit 06db49bab7
33 changed files with 121 additions and 38 deletions
@@ -57,7 +57,6 @@ import org.jetbrains.kotlin.idea.completion.test.handlers.AbstractKeywordComplet
import org.jetbrains.kotlin.idea.completion.test.handlers.AbstractSmartCompletionHandlerTest
import org.jetbrains.kotlin.idea.completion.test.weighers.AbstractBasicCompletionWeigherTest
import org.jetbrains.kotlin.idea.completion.test.weighers.AbstractSmartCompletionWeigherTest
import org.jetbrains.kotlin.idea.maven.configuration.AbstractMavenConfigureProjectByChangingFileTest
import org.jetbrains.kotlin.idea.conversion.copy.AbstractJavaToKotlinCopyPasteConversionTest
import org.jetbrains.kotlin.idea.coverage.AbstractKotlinCoverageOutputFilesTest
import org.jetbrains.kotlin.idea.debugger.AbstractBeforeExtractFunctionInsertionTest
@@ -86,6 +85,7 @@ import org.jetbrains.kotlin.idea.internal.AbstractBytecodeToolWindowTest
import org.jetbrains.kotlin.idea.kdoc.AbstractKDocHighlightingTest
import org.jetbrains.kotlin.idea.kdoc.AbstractKDocTypingTest
import org.jetbrains.kotlin.idea.maven.AbstractKotlinMavenInspectionTest
import org.jetbrains.kotlin.idea.maven.configuration.AbstractMavenConfigureProjectByChangingFileTest
import org.jetbrains.kotlin.idea.navigation.AbstractGotoSuperTest
import org.jetbrains.kotlin.idea.navigation.AbstractKotlinGotoImplementationTest
import org.jetbrains.kotlin.idea.navigation.AbstractKotlinGotoTest
@@ -508,6 +508,7 @@ fun main(args: Array<String>) {
model("codeInsight/moveUpDown/classBodyDeclarations", testMethod = "doTestClassBodyDeclaration")
model("codeInsight/moveUpDown/closingBraces", testMethod = "doTestExpression")
model("codeInsight/moveUpDown/expressions", testMethod = "doTestExpression")
model("codeInsight/moveUpDown/parametersAndArguments", testMethod = "doTestExpression")
}
testClass<AbstractInlineTest>() {
@@ -1,5 +1,4 @@
// MOVE: down
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
val x = foo(
<caret>a,
b,
@@ -1,5 +1,4 @@
// MOVE: down
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
val x = foo(
b,
<caret>a,
@@ -1,5 +1,4 @@
// MOVE: down
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
val x = foo(
b,
<caret>a,
@@ -1,5 +1,4 @@
// MOVE: down
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
val x = foo(
b,
c,
@@ -1,5 +1,4 @@
// MOVE: down
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
// IS_APPLICABLE: false
val x = foo(
b,
@@ -1,5 +1,4 @@
// MOVE: up
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
val x = foo(
b,
c,
@@ -1,5 +1,4 @@
// MOVE: up
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
val x = foo(
b,
<caret>a,
@@ -1,5 +1,4 @@
// MOVE: up
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
val x = foo(
b,
<caret>a,
@@ -1,5 +1,4 @@
// MOVE: up
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
val x = foo(
<caret>a,
b,
@@ -1,5 +1,4 @@
// MOVE: up
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
// IS_APPLICABLE: false
val x = foo(
<caret>a,
@@ -1,5 +1,4 @@
// MOVE: down
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
class A(
b:<caret> Int,
a: Int,
@@ -1,5 +1,4 @@
// MOVE: down
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
class A(
a: Int,
b:<caret> Int,
@@ -1,5 +1,4 @@
// MOVE: down
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
class A(
b: Int,
<caret>a: Int,
@@ -1,5 +1,4 @@
// MOVE: down
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
class A(
b: Int,
c: Int,
@@ -1,5 +1,4 @@
// MOVE: up
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
class A(
a: Int,
b:<caret> Int,
@@ -1,5 +1,4 @@
// MOVE: up
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
class A(
b:<caret> Int,
a: Int,
@@ -1,5 +1,4 @@
// MOVE: up
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
class A(
b: Int,
c: Int,
@@ -1,5 +1,4 @@
// MOVE: up
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
class A(
b: Int,
<caret>a: Int,
@@ -1,5 +1,4 @@
// MOVE: down
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
// IS_APPLICABLE: false
class A(
b: Int,
@@ -1,5 +1,4 @@
// MOVE: up
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
// IS_APPLICABLE: false
class A(
<caret>b: Int,
@@ -1,5 +1,4 @@
// MOVE: down
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
class A {
fun foo<T,
U,
@@ -1,5 +1,4 @@
// MOVE: down
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
class A {
fun foo<T,
U,
@@ -1,5 +1,4 @@
// MOVE: down
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
class A {
fun foo<T,
U,
@@ -1,5 +1,4 @@
// MOVE: down
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
class A {
fun foo<T,
U,
@@ -1,5 +1,4 @@
// MOVE: up
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
class A {
fun foo<T,
U,
@@ -1,5 +1,4 @@
// MOVE: up
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
class A {
fun foo<T,
U,
@@ -1,5 +1,4 @@
// MOVE: up
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
class A {
fun foo<T,
U,
@@ -1,5 +1,4 @@
// MOVE: up
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
class A {
fun foo<T,
U,
@@ -1,5 +1,4 @@
// MOVE: down
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
// IS_APPLICABLE: false
class A {
fun foo<T,
@@ -1,5 +1,4 @@
// MOVE: up
// MOVER_CLASS: org.jetbrains.kotlin.idea.codeInsight.upDownMover.JetExpressionMover
// IS_APPLICABLE: false
class A {
fun foo<T,
@@ -41,7 +41,7 @@ abstract class AbstractCodeMoverTest : LightCodeInsightTestCase() {
doTest(path, KotlinExpressionMover::class.java)
}
private fun doTest(path: String, defaultMoverClass: Class<out StatementUpDownMover>) {
private fun doTest(path: String, moverClass: Class<out StatementUpDownMover>) {
configureByFile(path)
val fileText = FileUtil.loadFile(File(path), true)
@@ -71,13 +71,8 @@ abstract class AbstractCodeMoverTest : LightCodeInsightTestCase() {
}
}
var moverClassName = InTextDirectivesUtils.findStringWithPrefixes(fileText, "// MOVER_CLASS: ")
if (moverClassName == null) {
moverClassName = defaultMoverClass.name
}
assertTrue("No mover found", actualMover != null)
assertEquals("Unmatched movers", moverClassName, actualMover!!.javaClass.name)
assertEquals("Unmatched movers", moverClass.name, actualMover!!.javaClass.name)
assertEquals("Invalid applicability", isApplicableExpected, info.toMove2 != null)
if (isApplicableExpected) {
@@ -1225,4 +1225,121 @@ public class CodeMoverTestGenerated extends AbstractCodeMoverTest {
doTestExpression(fileName);
}
}
@TestMetadata("idea/testData/codeInsight/moveUpDown/parametersAndArguments")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ParametersAndArguments extends AbstractCodeMoverTest {
public void testAllFilesPresentInParametersAndArguments() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/codeInsight/moveUpDown/parametersAndArguments"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("callArgs1.kt")
public void testCallArgs1() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/parametersAndArguments/callArgs1.kt");
doTestExpression(fileName);
}
@TestMetadata("callArgs2.kt")
public void testCallArgs2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/parametersAndArguments/callArgs2.kt");
doTestExpression(fileName);
}
@TestMetadata("callArgs3.kt")
public void testCallArgs3() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/parametersAndArguments/callArgs3.kt");
doTestExpression(fileName);
}
@TestMetadata("callArgs4.kt")
public void testCallArgs4() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/parametersAndArguments/callArgs4.kt");
doTestExpression(fileName);
}
@TestMetadata("callArgs5.kt")
public void testCallArgs5() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/parametersAndArguments/callArgs5.kt");
doTestExpression(fileName);
}
@TestMetadata("callArgs6.kt")
public void testCallArgs6() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/parametersAndArguments/callArgs6.kt");
doTestExpression(fileName);
}
@TestMetadata("classParams1.kt")
public void testClassParams1() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/parametersAndArguments/classParams1.kt");
doTestExpression(fileName);
}
@TestMetadata("classParams2.kt")
public void testClassParams2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/parametersAndArguments/classParams2.kt");
doTestExpression(fileName);
}
@TestMetadata("classParams3.kt")
public void testClassParams3() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/parametersAndArguments/classParams3.kt");
doTestExpression(fileName);
}
@TestMetadata("classParams4.kt")
public void testClassParams4() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/parametersAndArguments/classParams4.kt");
doTestExpression(fileName);
}
@TestMetadata("classParams5.kt")
public void testClassParams5() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/parametersAndArguments/classParams5.kt");
doTestExpression(fileName);
}
@TestMetadata("classParams6.kt")
public void testClassParams6() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/parametersAndArguments/classParams6.kt");
doTestExpression(fileName);
}
@TestMetadata("funParams1.kt")
public void testFunParams1() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/parametersAndArguments/funParams1.kt");
doTestExpression(fileName);
}
@TestMetadata("funParams2.kt")
public void testFunParams2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/parametersAndArguments/funParams2.kt");
doTestExpression(fileName);
}
@TestMetadata("funParams3.kt")
public void testFunParams3() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/parametersAndArguments/funParams3.kt");
doTestExpression(fileName);
}
@TestMetadata("funParams4.kt")
public void testFunParams4() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/parametersAndArguments/funParams4.kt");
doTestExpression(fileName);
}
@TestMetadata("funParams5.kt")
public void testFunParams5() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/parametersAndArguments/funParams5.kt");
doTestExpression(fileName);
}
@TestMetadata("funParams6.kt")
public void testFunParams6() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/moveUpDown/parametersAndArguments/funParams6.kt");
doTestExpression(fileName);
}
}
}