From b99e46b6f912bccba714dd5ce21a2b4b7481cc4f Mon Sep 17 00:00:00 2001 From: Wojciech Lopata Date: Wed, 1 May 2013 19:30:43 +0200 Subject: [PATCH] Cleanup in "type mismatch" tests --- ...terComponentFunctionReturnTypeMismatch1.kt | 0 ...terComponentFunctionReturnTypeMismatch2.kt | 0 ...terComponentFunctionReturnTypeMismatch3.kt | 0 ...terComponentFunctionReturnTypeMismatch4.kt | 0 ...terComponentFunctionReturnTypeMismatch5.kt | 0 ...oreComponentFunctionReturnTypeMismatch1.kt | 0 ...oreComponentFunctionReturnTypeMismatch2.kt | 0 ...oreComponentFunctionReturnTypeMismatch3.kt | 0 ...oreComponentFunctionReturnTypeMismatch4.kt | 0 ...oreComponentFunctionReturnTypeMismatch5.kt | 0 ...rChangeFunctionReturnTypeToFunctionType.kt | 0 .../afterTypeMismatchInInitializer.kt | 0 .../afterTypeMismatchInReturnStatement.kt | 0 ...eChangeFunctionReturnTypeToFunctionType.kt | 0 .../beforeTypeMismatchInInitializer.kt | 0 .../beforeTypeMismatchInReturnStatement.kt | 0 .../quickfix/QuickFixTestGenerated.java | 106 ++++++++++-------- 17 files changed, 62 insertions(+), 44 deletions(-) rename idea/testData/quickfix/typeMismatch/{ => componentFunctionReturnTypeMismatch}/afterComponentFunctionReturnTypeMismatch1.kt (100%) rename idea/testData/quickfix/typeMismatch/{ => componentFunctionReturnTypeMismatch}/afterComponentFunctionReturnTypeMismatch2.kt (100%) rename idea/testData/quickfix/typeMismatch/{ => componentFunctionReturnTypeMismatch}/afterComponentFunctionReturnTypeMismatch3.kt (100%) rename idea/testData/quickfix/typeMismatch/{ => componentFunctionReturnTypeMismatch}/afterComponentFunctionReturnTypeMismatch4.kt (100%) rename idea/testData/quickfix/typeMismatch/{ => componentFunctionReturnTypeMismatch}/afterComponentFunctionReturnTypeMismatch5.kt (100%) rename idea/testData/quickfix/typeMismatch/{ => componentFunctionReturnTypeMismatch}/beforeComponentFunctionReturnTypeMismatch1.kt (100%) rename idea/testData/quickfix/typeMismatch/{ => componentFunctionReturnTypeMismatch}/beforeComponentFunctionReturnTypeMismatch2.kt (100%) rename idea/testData/quickfix/typeMismatch/{ => componentFunctionReturnTypeMismatch}/beforeComponentFunctionReturnTypeMismatch3.kt (100%) rename idea/testData/quickfix/typeMismatch/{ => componentFunctionReturnTypeMismatch}/beforeComponentFunctionReturnTypeMismatch4.kt (100%) rename idea/testData/quickfix/typeMismatch/{ => componentFunctionReturnTypeMismatch}/beforeComponentFunctionReturnTypeMismatch5.kt (100%) rename idea/testData/quickfix/typeMismatch/{ => typeMismatchOnReturnedExpression}/afterChangeFunctionReturnTypeToFunctionType.kt (100%) rename idea/testData/quickfix/typeMismatch/{ => typeMismatchOnReturnedExpression}/afterTypeMismatchInInitializer.kt (100%) rename idea/testData/quickfix/typeMismatch/{ => typeMismatchOnReturnedExpression}/afterTypeMismatchInReturnStatement.kt (100%) rename idea/testData/quickfix/typeMismatch/{ => typeMismatchOnReturnedExpression}/beforeChangeFunctionReturnTypeToFunctionType.kt (100%) rename idea/testData/quickfix/typeMismatch/{ => typeMismatchOnReturnedExpression}/beforeTypeMismatchInInitializer.kt (100%) rename idea/testData/quickfix/typeMismatch/{ => typeMismatchOnReturnedExpression}/beforeTypeMismatchInReturnStatement.kt (100%) diff --git a/idea/testData/quickfix/typeMismatch/afterComponentFunctionReturnTypeMismatch1.kt b/idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/afterComponentFunctionReturnTypeMismatch1.kt similarity index 100% rename from idea/testData/quickfix/typeMismatch/afterComponentFunctionReturnTypeMismatch1.kt rename to idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/afterComponentFunctionReturnTypeMismatch1.kt diff --git a/idea/testData/quickfix/typeMismatch/afterComponentFunctionReturnTypeMismatch2.kt b/idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/afterComponentFunctionReturnTypeMismatch2.kt similarity index 100% rename from idea/testData/quickfix/typeMismatch/afterComponentFunctionReturnTypeMismatch2.kt rename to idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/afterComponentFunctionReturnTypeMismatch2.kt diff --git a/idea/testData/quickfix/typeMismatch/afterComponentFunctionReturnTypeMismatch3.kt b/idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/afterComponentFunctionReturnTypeMismatch3.kt similarity index 100% rename from idea/testData/quickfix/typeMismatch/afterComponentFunctionReturnTypeMismatch3.kt rename to idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/afterComponentFunctionReturnTypeMismatch3.kt diff --git a/idea/testData/quickfix/typeMismatch/afterComponentFunctionReturnTypeMismatch4.kt b/idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/afterComponentFunctionReturnTypeMismatch4.kt similarity index 100% rename from idea/testData/quickfix/typeMismatch/afterComponentFunctionReturnTypeMismatch4.kt rename to idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/afterComponentFunctionReturnTypeMismatch4.kt diff --git a/idea/testData/quickfix/typeMismatch/afterComponentFunctionReturnTypeMismatch5.kt b/idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/afterComponentFunctionReturnTypeMismatch5.kt similarity index 100% rename from idea/testData/quickfix/typeMismatch/afterComponentFunctionReturnTypeMismatch5.kt rename to idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/afterComponentFunctionReturnTypeMismatch5.kt diff --git a/idea/testData/quickfix/typeMismatch/beforeComponentFunctionReturnTypeMismatch1.kt b/idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/beforeComponentFunctionReturnTypeMismatch1.kt similarity index 100% rename from idea/testData/quickfix/typeMismatch/beforeComponentFunctionReturnTypeMismatch1.kt rename to idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/beforeComponentFunctionReturnTypeMismatch1.kt diff --git a/idea/testData/quickfix/typeMismatch/beforeComponentFunctionReturnTypeMismatch2.kt b/idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/beforeComponentFunctionReturnTypeMismatch2.kt similarity index 100% rename from idea/testData/quickfix/typeMismatch/beforeComponentFunctionReturnTypeMismatch2.kt rename to idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/beforeComponentFunctionReturnTypeMismatch2.kt diff --git a/idea/testData/quickfix/typeMismatch/beforeComponentFunctionReturnTypeMismatch3.kt b/idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/beforeComponentFunctionReturnTypeMismatch3.kt similarity index 100% rename from idea/testData/quickfix/typeMismatch/beforeComponentFunctionReturnTypeMismatch3.kt rename to idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/beforeComponentFunctionReturnTypeMismatch3.kt diff --git a/idea/testData/quickfix/typeMismatch/beforeComponentFunctionReturnTypeMismatch4.kt b/idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/beforeComponentFunctionReturnTypeMismatch4.kt similarity index 100% rename from idea/testData/quickfix/typeMismatch/beforeComponentFunctionReturnTypeMismatch4.kt rename to idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/beforeComponentFunctionReturnTypeMismatch4.kt diff --git a/idea/testData/quickfix/typeMismatch/beforeComponentFunctionReturnTypeMismatch5.kt b/idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/beforeComponentFunctionReturnTypeMismatch5.kt similarity index 100% rename from idea/testData/quickfix/typeMismatch/beforeComponentFunctionReturnTypeMismatch5.kt rename to idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/beforeComponentFunctionReturnTypeMismatch5.kt diff --git a/idea/testData/quickfix/typeMismatch/afterChangeFunctionReturnTypeToFunctionType.kt b/idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/afterChangeFunctionReturnTypeToFunctionType.kt similarity index 100% rename from idea/testData/quickfix/typeMismatch/afterChangeFunctionReturnTypeToFunctionType.kt rename to idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/afterChangeFunctionReturnTypeToFunctionType.kt diff --git a/idea/testData/quickfix/typeMismatch/afterTypeMismatchInInitializer.kt b/idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/afterTypeMismatchInInitializer.kt similarity index 100% rename from idea/testData/quickfix/typeMismatch/afterTypeMismatchInInitializer.kt rename to idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/afterTypeMismatchInInitializer.kt diff --git a/idea/testData/quickfix/typeMismatch/afterTypeMismatchInReturnStatement.kt b/idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/afterTypeMismatchInReturnStatement.kt similarity index 100% rename from idea/testData/quickfix/typeMismatch/afterTypeMismatchInReturnStatement.kt rename to idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/afterTypeMismatchInReturnStatement.kt diff --git a/idea/testData/quickfix/typeMismatch/beforeChangeFunctionReturnTypeToFunctionType.kt b/idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/beforeChangeFunctionReturnTypeToFunctionType.kt similarity index 100% rename from idea/testData/quickfix/typeMismatch/beforeChangeFunctionReturnTypeToFunctionType.kt rename to idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/beforeChangeFunctionReturnTypeToFunctionType.kt diff --git a/idea/testData/quickfix/typeMismatch/beforeTypeMismatchInInitializer.kt b/idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/beforeTypeMismatchInInitializer.kt similarity index 100% rename from idea/testData/quickfix/typeMismatch/beforeTypeMismatchInInitializer.kt rename to idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/beforeTypeMismatchInInitializer.kt diff --git a/idea/testData/quickfix/typeMismatch/beforeTypeMismatchInReturnStatement.kt b/idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/beforeTypeMismatchInReturnStatement.kt similarity index 100% rename from idea/testData/quickfix/typeMismatch/beforeTypeMismatchInReturnStatement.kt rename to idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/beforeTypeMismatchInReturnStatement.kt diff --git a/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixTestGenerated.java b/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixTestGenerated.java index 0d9ee817a72..fb646cabc37 100644 --- a/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixTestGenerated.java @@ -1240,20 +1240,15 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest { } @TestMetadata("idea/testData/quickfix/typeMismatch") - @InnerTestClasses({TypeMismatch.Casts.class}) + @InnerTestClasses({TypeMismatch.Casts.class, TypeMismatch.ComponentFunctionReturnTypeMismatch.class, TypeMismatch.TypeMismatchOnReturnedExpression.class}) public static class TypeMismatch extends AbstractQuickFixTest { public void testAllFilesPresentInTypeMismatch() throws Exception { JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/typeMismatch"), Pattern.compile("^before(\\w+)\\.kt$"), true); } - @TestMetadata("beforeChangeFunctionReturnTypeToFunctionType.kt") - public void testChangeFunctionReturnTypeToFunctionType() throws Exception { - doTest("idea/testData/quickfix/typeMismatch/beforeChangeFunctionReturnTypeToFunctionType.kt"); - } - - @TestMetadata("beforeChangeParameterTypeToFunctionType.kt") - public void testChangeParameterTypeToFunctionType() throws Exception { - doTest("idea/testData/quickfix/typeMismatch/beforeChangeParameterTypeToFunctionType.kt"); + @TestMetadata("beforeChangeFunctionLiteralParameterTypeToFunctionType.kt") + public void testChangeFunctionLiteralParameterTypeToFunctionType() throws Exception { + doTest("idea/testData/quickfix/typeMismatch/beforeChangeFunctionLiteralParameterTypeToFunctionType.kt"); } @TestMetadata("beforeChangeReturnTypeWhenFunctionNameIsMissing.kt") @@ -1271,31 +1266,6 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest { doTest("idea/testData/quickfix/typeMismatch/beforeCompareToTypeMismatch.kt"); } - @TestMetadata("beforeComponentFunctionReturnTypeMismatch1.kt") - public void testComponentFunctionReturnTypeMismatch1() throws Exception { - doTest("idea/testData/quickfix/typeMismatch/beforeComponentFunctionReturnTypeMismatch1.kt"); - } - - @TestMetadata("beforeComponentFunctionReturnTypeMismatch2.kt") - public void testComponentFunctionReturnTypeMismatch2() throws Exception { - doTest("idea/testData/quickfix/typeMismatch/beforeComponentFunctionReturnTypeMismatch2.kt"); - } - - @TestMetadata("beforeComponentFunctionReturnTypeMismatch3.kt") - public void testComponentFunctionReturnTypeMismatch3() throws Exception { - doTest("idea/testData/quickfix/typeMismatch/beforeComponentFunctionReturnTypeMismatch3.kt"); - } - - @TestMetadata("beforeComponentFunctionReturnTypeMismatch4.kt") - public void testComponentFunctionReturnTypeMismatch4() throws Exception { - doTest("idea/testData/quickfix/typeMismatch/beforeComponentFunctionReturnTypeMismatch4.kt"); - } - - @TestMetadata("beforeComponentFunctionReturnTypeMismatch5.kt") - public void testComponentFunctionReturnTypeMismatch5() throws Exception { - doTest("idea/testData/quickfix/typeMismatch/beforeComponentFunctionReturnTypeMismatch5.kt"); - } - @TestMetadata("beforeExpectedParameterTypeMismatch.kt") public void testExpectedParameterTypeMismatch() throws Exception { doTest("idea/testData/quickfix/typeMismatch/beforeExpectedParameterTypeMismatch.kt"); @@ -1321,16 +1291,6 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest { doTest("idea/testData/quickfix/typeMismatch/beforeReturnTypeMismatch.kt"); } - @TestMetadata("beforeTypeMismatchInInitializer.kt") - public void testTypeMismatchInInitializer() throws Exception { - doTest("idea/testData/quickfix/typeMismatch/beforeTypeMismatchInInitializer.kt"); - } - - @TestMetadata("beforeTypeMismatchInReturnStatement.kt") - public void testTypeMismatchInReturnStatement() throws Exception { - doTest("idea/testData/quickfix/typeMismatch/beforeTypeMismatchInReturnStatement.kt"); - } - @TestMetadata("idea/testData/quickfix/typeMismatch/casts") public static class Casts extends AbstractQuickFixTest { public void testAllFilesPresentInCasts() throws Exception { @@ -1384,10 +1344,68 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest { } + @TestMetadata("idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch") + public static class ComponentFunctionReturnTypeMismatch extends AbstractQuickFixTest { + public void testAllFilesPresentInComponentFunctionReturnTypeMismatch() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("beforeComponentFunctionReturnTypeMismatch1.kt") + public void testComponentFunctionReturnTypeMismatch1() throws Exception { + doTest("idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/beforeComponentFunctionReturnTypeMismatch1.kt"); + } + + @TestMetadata("beforeComponentFunctionReturnTypeMismatch2.kt") + public void testComponentFunctionReturnTypeMismatch2() throws Exception { + doTest("idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/beforeComponentFunctionReturnTypeMismatch2.kt"); + } + + @TestMetadata("beforeComponentFunctionReturnTypeMismatch3.kt") + public void testComponentFunctionReturnTypeMismatch3() throws Exception { + doTest("idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/beforeComponentFunctionReturnTypeMismatch3.kt"); + } + + @TestMetadata("beforeComponentFunctionReturnTypeMismatch4.kt") + public void testComponentFunctionReturnTypeMismatch4() throws Exception { + doTest("idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/beforeComponentFunctionReturnTypeMismatch4.kt"); + } + + @TestMetadata("beforeComponentFunctionReturnTypeMismatch5.kt") + public void testComponentFunctionReturnTypeMismatch5() throws Exception { + doTest("idea/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/beforeComponentFunctionReturnTypeMismatch5.kt"); + } + + } + + @TestMetadata("idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression") + public static class TypeMismatchOnReturnedExpression extends AbstractQuickFixTest { + public void testAllFilesPresentInTypeMismatchOnReturnedExpression() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("beforeChangeFunctionReturnTypeToFunctionType.kt") + public void testChangeFunctionReturnTypeToFunctionType() throws Exception { + doTest("idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/beforeChangeFunctionReturnTypeToFunctionType.kt"); + } + + @TestMetadata("beforeTypeMismatchInInitializer.kt") + public void testTypeMismatchInInitializer() throws Exception { + doTest("idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/beforeTypeMismatchInInitializer.kt"); + } + + @TestMetadata("beforeTypeMismatchInReturnStatement.kt") + public void testTypeMismatchInReturnStatement() throws Exception { + doTest("idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression/beforeTypeMismatchInReturnStatement.kt"); + } + + } + public static Test innerSuite() { TestSuite suite = new TestSuite("TypeMismatch"); suite.addTestSuite(TypeMismatch.class); suite.addTestSuite(Casts.class); + suite.addTestSuite(ComponentFunctionReturnTypeMismatch.class); + suite.addTestSuite(TypeMismatchOnReturnedExpression.class); return suite; } }