diff --git a/generators/src/org/jetbrains/jet/generators/tests/GenerateTests.kt b/generators/src/org/jetbrains/jet/generators/tests/GenerateTests.kt index 030dc54d3cf..2fef7609add 100644 --- a/generators/src/org/jetbrains/jet/generators/tests/GenerateTests.kt +++ b/generators/src/org/jetbrains/jet/generators/tests/GenerateTests.kt @@ -83,6 +83,7 @@ import org.jetbrains.jet.j2k.test.AbstractJavaToKotlinConverterBasicTest import org.jetbrains.jet.plugin.conversion.copy.AbstractJavaToKotlinCopyPasteConversionTest import org.jetbrains.jet.shortenRefs.AbstractShortenRefsTest import org.jetbrains.jet.completion.handlers.AbstractSmartCompletionHandlerTest +import org.jetbrains.jet.generators.tests.generator.TestGeneratorUtil import org.jetbrains.jet.resolve.AbstractAdditionalLazyResolveDescriptorRendererTest import org.jetbrains.jet.resolve.AbstractReferenceResolveInLibrarySourcesTest @@ -414,7 +415,9 @@ fun main(args: Array) { } testClass(javaClass()) { - model("formatter", pattern = """^([^\.]+)\.kt$""") + model("formatter", pattern = """^([^\.]+)\.after.kt$""") + model("formatter", pattern = """^([^\.]+)\.after.inv.kt$""", + testMethod = "doTestInverted", testClassName = "FormatterInverted") } testClass(javaClass()) { @@ -482,14 +485,16 @@ private class TestGroup(val testsRoot: String, val testDataRoot: String) { extension: String? = "kt", // null string means dir (name without dot) pattern: String = if (extension == null) """^([^\.]+)$""" else "^(.+)\\.$extension\$", testMethod: String = "doTest", - singleClass: Boolean = false + singleClass: Boolean = false, + testClassName: String? = null ) { val rootFile = File(testDataRoot + "/" + relativeRootPath) val compiledPattern = Pattern.compile(pattern) + val className = testClassName ?: TestGeneratorUtil.fileNameToJavaIdentifier(rootFile) testModels.add(if (singleClass) - SingleClassTestModel(rootFile, compiledPattern, testMethod) + SingleClassTestModel(rootFile, compiledPattern, testMethod, className) else - SimpleTestClassModel(rootFile, recursive, compiledPattern, testMethod)) + SimpleTestClassModel(rootFile, recursive, compiledPattern, testMethod, className)) } } diff --git a/generators/src/org/jetbrains/jet/generators/tests/generator/SimpleTestClassModel.java b/generators/src/org/jetbrains/jet/generators/tests/generator/SimpleTestClassModel.java index 797d17f80bf..eb3fcc91a0f 100644 --- a/generators/src/org/jetbrains/jet/generators/tests/generator/SimpleTestClassModel.java +++ b/generators/src/org/jetbrains/jet/generators/tests/generator/SimpleTestClassModel.java @@ -47,12 +47,18 @@ public class SimpleTestClassModel implements TestClassModel { private Collection innerTestClasses; private Collection testMethods; - public SimpleTestClassModel(@NotNull File rootFile, boolean recursive, @NotNull Pattern filenamePattern, @NotNull String doTestMethodName) { + public SimpleTestClassModel( + @NotNull File rootFile, + boolean recursive, + @NotNull Pattern filenamePattern, + @NotNull String doTestMethodName, + @NotNull String testClassName + ) { this.rootFile = rootFile; this.recursive = recursive; this.filenamePattern = filenamePattern; this.doTestMethodName = doTestMethodName; - this.testClassName = StringUtil.capitalize(TestGeneratorUtil.escapeForJavaIdentifier(rootFile.getName())); + this.testClassName = testClassName; } @NotNull @@ -69,7 +75,8 @@ public class SimpleTestClassModel implements TestClassModel { for (File file : files) { if (file.isDirectory()) { if (dirHasFilesInside(file)) { - children.add(new SimpleTestClassModel(file, true, filenamePattern, doTestMethodName)); + String innerTestClassName = TestGeneratorUtil.fileNameToJavaIdentifier(file); + children.add(new SimpleTestClassModel(file, true, filenamePattern, doTestMethodName, innerTestClassName)); } } } diff --git a/generators/src/org/jetbrains/jet/generators/tests/generator/SingleClassTestModel.java b/generators/src/org/jetbrains/jet/generators/tests/generator/SingleClassTestModel.java index ec4610679a4..b65e95fbaa4 100644 --- a/generators/src/org/jetbrains/jet/generators/tests/generator/SingleClassTestModel.java +++ b/generators/src/org/jetbrains/jet/generators/tests/generator/SingleClassTestModel.java @@ -40,11 +40,16 @@ public class SingleClassTestModel implements TestClassModel { private Collection testMethods; - public SingleClassTestModel(@NotNull File rootFile, @NotNull Pattern filenamePattern, @NotNull String doTestMethodName) { + public SingleClassTestModel( + @NotNull File rootFile, + @NotNull Pattern filenamePattern, + @NotNull String doTestMethodName, + @NotNull String testClassName + ) { this.rootFile = rootFile; this.filenamePattern = filenamePattern; this.doTestMethodName = doTestMethodName; - this.testClassName = StringUtil.capitalize(TestGeneratorUtil.escapeForJavaIdentifier(rootFile.getName())); + this.testClassName = testClassName; } @NotNull diff --git a/generators/src/org/jetbrains/jet/generators/tests/generator/TestGeneratorUtil.java b/generators/src/org/jetbrains/jet/generators/tests/generator/TestGeneratorUtil.java index 755076b36d4..2529536c992 100644 --- a/generators/src/org/jetbrains/jet/generators/tests/generator/TestGeneratorUtil.java +++ b/generators/src/org/jetbrains/jet/generators/tests/generator/TestGeneratorUtil.java @@ -16,7 +16,13 @@ package org.jetbrains.jet.generators.tests.generator; +import com.intellij.openapi.util.text.StringUtil; +import org.jetbrains.annotations.NotNull; + +import java.io.File; + public class TestGeneratorUtil { + @NotNull public static String escapeForJavaIdentifier(String fileName) { // A file name may contain characters (like ".") that can't be a part of method name StringBuilder result = new StringBuilder(); @@ -32,4 +38,9 @@ public class TestGeneratorUtil { } return result.toString(); } + + @NotNull + public static String fileNameToJavaIdentifier(@NotNull File file) { + return StringUtil.capitalize(escapeForJavaIdentifier(file.getName())); + } } diff --git a/idea/tests/org/jetbrains/jet/formatter/AbstractJetFormatterTest.java b/idea/tests/org/jetbrains/jet/formatter/AbstractJetFormatterTest.java index 179b8745920..7966497e74f 100644 --- a/idea/tests/org/jetbrains/jet/formatter/AbstractJetFormatterTest.java +++ b/idea/tests/org/jetbrains/jet/formatter/AbstractJetFormatterTest.java @@ -30,6 +30,7 @@ import com.intellij.psi.codeStyle.CodeStyleManager; import com.intellij.testFramework.LightIdeaTestCase; import com.intellij.util.IncorrectOperationException; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.JetTestUtils; import org.jetbrains.jet.plugin.PluginTestCaseBase; import org.jetbrains.jet.testing.SettingsConfigurator; @@ -125,19 +126,26 @@ public abstract class AbstractJetFormatterTest extends LightIdeaTestCase { JetTestUtils.assertEqualsToFile(fileAfter, file.getText()); } - public void doTest(String testFileNameWithExtension) throws Exception { - String testFileName = FileUtil.getNameWithoutExtension(testFileNameWithExtension); + public void doTest(@NotNull String expectedFileNameWithExtension) throws Exception { + doTest(expectedFileNameWithExtension, false); + } + + public void doTestInverted(@NotNull String expectedFileNameWithExtension) throws Exception { + doTest(expectedFileNameWithExtension, true); + } + + public void doTest(@NotNull String expectedFileNameWithExtension, boolean inverted) throws Exception { + String testFileName = expectedFileNameWithExtension.substring(0, expectedFileNameWithExtension.indexOf(".")); String originalFileText = FileUtil.loadFile(new File(testFileName + ".kt"), true); SettingsConfigurator configurator = JetFormatSettingsUtil.createConfigurator(originalFileText, JetFormatSettingsUtil.getSettings()); - configurator.configureSettings(); - doTextTest(originalFileText, new File(testFileName + ".after.kt")); - - String afterInvertedFileName = testFileName + ".after.inv.kt"; - if (new File(afterInvertedFileName).exists()) { - configurator.configureInvertedSettings(); - doTextTest(originalFileText, new File(afterInvertedFileName)); + if (!inverted) { + configurator.configureSettings(); } + else { + configurator.configureInvertedSettings(); + } + doTextTest(originalFileText, new File(expectedFileNameWithExtension)); JetFormatSettingsUtil.getSettings().clearCodeStyleSettings(); } diff --git a/idea/tests/org/jetbrains/jet/formatter/JetFormatterTestGenerated.java b/idea/tests/org/jetbrains/jet/formatter/JetFormatterTestGenerated.java index c50c67af6c1..d4c0926e660 100644 --- a/idea/tests/org/jetbrains/jet/formatter/JetFormatterTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/formatter/JetFormatterTestGenerated.java @@ -30,305 +30,389 @@ import org.jetbrains.jet.formatter.AbstractJetFormatterTest; /** This class is generated by {@link org.jetbrains.jet.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") -@TestMetadata("idea/testData/formatter") -@InnerTestClasses({JetFormatterTestGenerated.ModifierList.class}) +@InnerTestClasses({JetFormatterTestGenerated.Formatter.class, JetFormatterTestGenerated.FormatterInverted.class}) public class JetFormatterTestGenerated extends AbstractJetFormatterTest { - public void testAllFilesPresentInFormatter() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/formatter"), Pattern.compile("^([^\\.]+)\\.kt$"), true); - } - - @TestMetadata("BlockFor.kt") - public void testBlockFor() throws Exception { - doTest("idea/testData/formatter/BlockFor.kt"); - } - - @TestMetadata("Class.kt") - public void testClass() throws Exception { - doTest("idea/testData/formatter/Class.kt"); - } - - @TestMetadata("CommentInFunctionLiteral.kt") - public void testCommentInFunctionLiteral() throws Exception { - doTest("idea/testData/formatter/CommentInFunctionLiteral.kt"); - } - - @TestMetadata("ConsecutiveCalls.kt") - public void testConsecutiveCalls() throws Exception { - doTest("idea/testData/formatter/ConsecutiveCalls.kt"); - } - - @TestMetadata("DoWhileSpacing.kt") - public void testDoWhileSpacing() throws Exception { - doTest("idea/testData/formatter/DoWhileSpacing.kt"); - } - - @TestMetadata("EmptyLineAfterPackage.kt") - public void testEmptyLineAfterPackage() throws Exception { - doTest("idea/testData/formatter/EmptyLineAfterPackage.kt"); - } - - @TestMetadata("ForNoBraces.kt") - public void testForNoBraces() throws Exception { - doTest("idea/testData/formatter/ForNoBraces.kt"); - } - - @TestMetadata("ForSpacing.kt") - public void testForSpacing() throws Exception { - doTest("idea/testData/formatter/ForSpacing.kt"); - } - - @TestMetadata("FunctionCallParametersAlign.kt") - public void testFunctionCallParametersAlign() throws Exception { - doTest("idea/testData/formatter/FunctionCallParametersAlign.kt"); - } - - @TestMetadata("FunctionDefParametersAlign.kt") - public void testFunctionDefParametersAlign() throws Exception { - doTest("idea/testData/formatter/FunctionDefParametersAlign.kt"); - } - - @TestMetadata("FunctionWithInference.kt") - public void testFunctionWithInference() throws Exception { - doTest("idea/testData/formatter/FunctionWithInference.kt"); - } - - @TestMetadata("FunctionWithNewLineBrace.kt") - public void testFunctionWithNewLineBrace() throws Exception { - doTest("idea/testData/formatter/FunctionWithNewLineBrace.kt"); - } - - @TestMetadata("FunctionalType.kt") - public void testFunctionalType() throws Exception { - doTest("idea/testData/formatter/FunctionalType.kt"); - } - - @TestMetadata("GetterAndSetter.kt") - public void testGetterAndSetter() throws Exception { - doTest("idea/testData/formatter/GetterAndSetter.kt"); - } - - @TestMetadata("If.kt") - public void testIf() throws Exception { - doTest("idea/testData/formatter/If.kt"); - } - - @TestMetadata("IfElseRemoveLineBreak.kt") - public void testIfElseRemoveLineBreak() throws Exception { - doTest("idea/testData/formatter/IfElseRemoveLineBreak.kt"); - } - - @TestMetadata("IfElseWithLineBreak.kt") - public void testIfElseWithLineBreak() throws Exception { - doTest("idea/testData/formatter/IfElseWithLineBreak.kt"); - } - - @TestMetadata("IfElseWithTrickyComments.kt") - public void testIfElseWithTrickyComments() throws Exception { - doTest("idea/testData/formatter/IfElseWithTrickyComments.kt"); - } - - @TestMetadata("IfSpacing.kt") - public void testIfSpacing() throws Exception { - doTest("idea/testData/formatter/IfSpacing.kt"); - } - - @TestMetadata("KDoc.kt") - public void testKDoc() throws Exception { - doTest("idea/testData/formatter/KDoc.kt"); - } - - @TestMetadata("LambdaArrow.kt") - public void testLambdaArrow() throws Exception { - doTest("idea/testData/formatter/LambdaArrow.kt"); - } - - @TestMetadata("MultilineFunctionLiteral.kt") - public void testMultilineFunctionLiteral() throws Exception { - doTest("idea/testData/formatter/MultilineFunctionLiteral.kt"); - } - - @TestMetadata("MultilineFunctionLiteralWithParams.kt") - public void testMultilineFunctionLiteralWithParams() throws Exception { - doTest("idea/testData/formatter/MultilineFunctionLiteralWithParams.kt"); - } - - @TestMetadata("Parameters.kt") - public void testParameters() throws Exception { - doTest("idea/testData/formatter/Parameters.kt"); - } - - @TestMetadata("PropertyWithInference.kt") - public void testPropertyWithInference() throws Exception { - doTest("idea/testData/formatter/PropertyWithInference.kt"); - } - - @TestMetadata("ReferenceExpressionFunctionLiteral.kt") - public void testReferenceExpressionFunctionLiteral() throws Exception { - doTest("idea/testData/formatter/ReferenceExpressionFunctionLiteral.kt"); - } - - @TestMetadata("RemoveSpacesAroundOperations.kt") - public void testRemoveSpacesAroundOperations() throws Exception { - doTest("idea/testData/formatter/RemoveSpacesAroundOperations.kt"); - } - - @TestMetadata("RightBracketOnNewLine.kt") - public void testRightBracketOnNewLine() throws Exception { - doTest("idea/testData/formatter/RightBracketOnNewLine.kt"); - } - - @TestMetadata("SaveSpacesInDocComments.kt") - public void testSaveSpacesInDocComments() throws Exception { - doTest("idea/testData/formatter/SaveSpacesInDocComments.kt"); - } - - @TestMetadata("SingleLineFunctionLiteral.kt") - public void testSingleLineFunctionLiteral() throws Exception { - doTest("idea/testData/formatter/SingleLineFunctionLiteral.kt"); - } - - @TestMetadata("SpaceAroundExtendColon.kt") - public void testSpaceAroundExtendColon() throws Exception { - doTest("idea/testData/formatter/SpaceAroundExtendColon.kt"); - } - - @TestMetadata("SpaceBeforeFunctionLiteral.kt") - public void testSpaceBeforeFunctionLiteral() throws Exception { - doTest("idea/testData/formatter/SpaceBeforeFunctionLiteral.kt"); - } - - @TestMetadata("SpacesAroundOperations.kt") - public void testSpacesAroundOperations() throws Exception { - doTest("idea/testData/formatter/SpacesAroundOperations.kt"); - } - - @TestMetadata("SpacesAroundUnaryOperations.kt") - public void testSpacesAroundUnaryOperations() throws Exception { - doTest("idea/testData/formatter/SpacesAroundUnaryOperations.kt"); - } - - @TestMetadata("UnnecessarySpacesInParametersLists.kt") - public void testUnnecessarySpacesInParametersLists() throws Exception { - doTest("idea/testData/formatter/UnnecessarySpacesInParametersLists.kt"); - } - - @TestMetadata("When.kt") - public void testWhen() throws Exception { - doTest("idea/testData/formatter/When.kt"); - } - - @TestMetadata("WhenArrow.kt") - public void testWhenArrow() throws Exception { - doTest("idea/testData/formatter/WhenArrow.kt"); - } - - @TestMetadata("WhenEntryExpr.kt") - public void testWhenEntryExpr() throws Exception { - doTest("idea/testData/formatter/WhenEntryExpr.kt"); - } - - @TestMetadata("WhenLinesBeforeLbrace.kt") - public void testWhenLinesBeforeLbrace() throws Exception { - doTest("idea/testData/formatter/WhenLinesBeforeLbrace.kt"); - } - - @TestMetadata("WhileSpacing.kt") - public void testWhileSpacing() throws Exception { - doTest("idea/testData/formatter/WhileSpacing.kt"); - } - - @TestMetadata("idea/testData/formatter/modifierList") - public static class ModifierList extends AbstractJetFormatterTest { - public void testAllFilesPresentInModifierList() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/formatter/modifierList"), Pattern.compile("^([^\\.]+)\\.kt$"), true); + @TestMetadata("idea/testData/formatter") + @InnerTestClasses({Formatter.ModifierList.class}) + public static class Formatter extends AbstractJetFormatterTest { + public void testAllFilesPresentInFormatter() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/formatter"), Pattern.compile("^([^\\.]+)\\.after.kt$"), true); } - @TestMetadata("funAnnotationBeforeAnnotation.kt") - public void testFunAnnotationBeforeAnnotation() throws Exception { - doTest("idea/testData/formatter/modifierList/funAnnotationBeforeAnnotation.kt"); + @TestMetadata("BlockFor.after.kt") + public void testBlockFor() throws Exception { + doTest("idea/testData/formatter/BlockFor.after.kt"); } - @TestMetadata("funAnnotationBeforeAnnotationEntry.kt") - public void testFunAnnotationBeforeAnnotationEntry() throws Exception { - doTest("idea/testData/formatter/modifierList/funAnnotationBeforeAnnotationEntry.kt"); + @TestMetadata("Class.after.kt") + public void testClass() throws Exception { + doTest("idea/testData/formatter/Class.after.kt"); } - @TestMetadata("funAnnotationBeforeModifiers.kt") - public void testFunAnnotationBeforeModifiers() throws Exception { - doTest("idea/testData/formatter/modifierList/funAnnotationBeforeModifiers.kt"); + @TestMetadata("CommentInFunctionLiteral.after.kt") + public void testCommentInFunctionLiteral() throws Exception { + doTest("idea/testData/formatter/CommentInFunctionLiteral.after.kt"); } - @TestMetadata("funAnnotationEntryBeforeAnnotation.kt") - public void testFunAnnotationEntryBeforeAnnotation() throws Exception { - doTest("idea/testData/formatter/modifierList/funAnnotationEntryBeforeAnnotation.kt"); + @TestMetadata("ConsecutiveCalls.after.kt") + public void testConsecutiveCalls() throws Exception { + doTest("idea/testData/formatter/ConsecutiveCalls.after.kt"); } - @TestMetadata("funAnnotationEntryBeforeAnnotationEntry.kt") - public void testFunAnnotationEntryBeforeAnnotationEntry() throws Exception { - doTest("idea/testData/formatter/modifierList/funAnnotationEntryBeforeAnnotationEntry.kt"); + @TestMetadata("DoWhileSpacing.after.kt") + public void testDoWhileSpacing() throws Exception { + doTest("idea/testData/formatter/DoWhileSpacing.after.kt"); } - @TestMetadata("funAnnotationEntryBeforeModifiers.kt") - public void testFunAnnotationEntryBeforeModifiers() throws Exception { - doTest("idea/testData/formatter/modifierList/funAnnotationEntryBeforeModifiers.kt"); + @TestMetadata("EmptyLineAfterPackage.after.kt") + public void testEmptyLineAfterPackage() throws Exception { + doTest("idea/testData/formatter/EmptyLineAfterPackage.after.kt"); } - @TestMetadata("funModifierBeforeAnnotation.kt") - public void testFunModifierBeforeAnnotation() throws Exception { - doTest("idea/testData/formatter/modifierList/funModifierBeforeAnnotation.kt"); + @TestMetadata("ForNoBraces.after.kt") + public void testForNoBraces() throws Exception { + doTest("idea/testData/formatter/ForNoBraces.after.kt"); } - @TestMetadata("funModifierBeforeAnnotationEntry.kt") - public void testFunModifierBeforeAnnotationEntry() throws Exception { - doTest("idea/testData/formatter/modifierList/funModifierBeforeAnnotationEntry.kt"); + @TestMetadata("ForSpacing.after.kt") + public void testForSpacing() throws Exception { + doTest("idea/testData/formatter/ForSpacing.after.kt"); } - @TestMetadata("funModifierBeforeModifiers.kt") - public void testFunModifierBeforeModifiers() throws Exception { - doTest("idea/testData/formatter/modifierList/funModifierBeforeModifiers.kt"); + @TestMetadata("FunctionCallParametersAlign.after.kt") + public void testFunctionCallParametersAlign() throws Exception { + doTest("idea/testData/formatter/FunctionCallParametersAlign.after.kt"); } - @TestMetadata("funTheOnlyModifier.kt") - public void testFunTheOnlyModifier() throws Exception { - doTest("idea/testData/formatter/modifierList/funTheOnlyModifier.kt"); + @TestMetadata("FunctionDefParametersAlign.after.kt") + public void testFunctionDefParametersAlign() throws Exception { + doTest("idea/testData/formatter/FunctionDefParametersAlign.after.kt"); } - @TestMetadata("memberFunTheOnlyModifier.kt") - public void testMemberFunTheOnlyModifier() throws Exception { - doTest("idea/testData/formatter/modifierList/memberFunTheOnlyModifier.kt"); + @TestMetadata("FunctionWithInference.after.kt") + public void testFunctionWithInference() throws Exception { + doTest("idea/testData/formatter/FunctionWithInference.after.kt"); } - @TestMetadata("memberValTheOnlyModifier.kt") - public void testMemberValTheOnlyModifier() throws Exception { - doTest("idea/testData/formatter/modifierList/memberValTheOnlyModifier.kt"); + @TestMetadata("FunctionWithNewLineBrace.after.kt") + public void testFunctionWithNewLineBrace() throws Exception { + doTest("idea/testData/formatter/FunctionWithNewLineBrace.after.kt"); } - @TestMetadata("memberVarTheOnlyModifier.kt") - public void testMemberVarTheOnlyModifier() throws Exception { - doTest("idea/testData/formatter/modifierList/memberVarTheOnlyModifier.kt"); + @TestMetadata("FunctionalType.after.kt") + public void testFunctionalType() throws Exception { + doTest("idea/testData/formatter/FunctionalType.after.kt"); } - @TestMetadata("secondMemberFunTheOnlyModifier.kt") - public void testSecondMemberFunTheOnlyModifier() throws Exception { - doTest("idea/testData/formatter/modifierList/secondMemberFunTheOnlyModifier.kt"); + @TestMetadata("GetterAndSetter.after.kt") + public void testGetterAndSetter() throws Exception { + doTest("idea/testData/formatter/GetterAndSetter.after.kt"); } - @TestMetadata("secondMemberValTheOnlyModifier.kt") - public void testSecondMemberValTheOnlyModifier() throws Exception { - doTest("idea/testData/formatter/modifierList/secondMemberValTheOnlyModifier.kt"); + @TestMetadata("If.after.kt") + public void testIf() throws Exception { + doTest("idea/testData/formatter/If.after.kt"); } - @TestMetadata("secondMemberVarTheOnlyModifier.kt") - public void testSecondMemberVarTheOnlyModifier() throws Exception { - doTest("idea/testData/formatter/modifierList/secondMemberVarTheOnlyModifier.kt"); + @TestMetadata("IfElseRemoveLineBreak.after.kt") + public void testIfElseRemoveLineBreak() throws Exception { + doTest("idea/testData/formatter/IfElseRemoveLineBreak.after.kt"); } + @TestMetadata("IfElseWithLineBreak.after.kt") + public void testIfElseWithLineBreak() throws Exception { + doTest("idea/testData/formatter/IfElseWithLineBreak.after.kt"); + } + + @TestMetadata("IfElseWithTrickyComments.after.kt") + public void testIfElseWithTrickyComments() throws Exception { + doTest("idea/testData/formatter/IfElseWithTrickyComments.after.kt"); + } + + @TestMetadata("IfSpacing.after.kt") + public void testIfSpacing() throws Exception { + doTest("idea/testData/formatter/IfSpacing.after.kt"); + } + + @TestMetadata("KDoc.after.kt") + public void testKDoc() throws Exception { + doTest("idea/testData/formatter/KDoc.after.kt"); + } + + @TestMetadata("LambdaArrow.after.kt") + public void testLambdaArrow() throws Exception { + doTest("idea/testData/formatter/LambdaArrow.after.kt"); + } + + @TestMetadata("MultilineFunctionLiteral.after.kt") + public void testMultilineFunctionLiteral() throws Exception { + doTest("idea/testData/formatter/MultilineFunctionLiteral.after.kt"); + } + + @TestMetadata("MultilineFunctionLiteralWithParams.after.kt") + public void testMultilineFunctionLiteralWithParams() throws Exception { + doTest("idea/testData/formatter/MultilineFunctionLiteralWithParams.after.kt"); + } + + @TestMetadata("Parameters.after.kt") + public void testParameters() throws Exception { + doTest("idea/testData/formatter/Parameters.after.kt"); + } + + @TestMetadata("PropertyWithInference.after.kt") + public void testPropertyWithInference() throws Exception { + doTest("idea/testData/formatter/PropertyWithInference.after.kt"); + } + + @TestMetadata("ReferenceExpressionFunctionLiteral.after.kt") + public void testReferenceExpressionFunctionLiteral() throws Exception { + doTest("idea/testData/formatter/ReferenceExpressionFunctionLiteral.after.kt"); + } + + @TestMetadata("RemoveSpacesAroundOperations.after.kt") + public void testRemoveSpacesAroundOperations() throws Exception { + doTest("idea/testData/formatter/RemoveSpacesAroundOperations.after.kt"); + } + + @TestMetadata("RightBracketOnNewLine.after.kt") + public void testRightBracketOnNewLine() throws Exception { + doTest("idea/testData/formatter/RightBracketOnNewLine.after.kt"); + } + + @TestMetadata("SaveSpacesInDocComments.after.kt") + public void testSaveSpacesInDocComments() throws Exception { + doTest("idea/testData/formatter/SaveSpacesInDocComments.after.kt"); + } + + @TestMetadata("SingleLineFunctionLiteral.after.kt") + public void testSingleLineFunctionLiteral() throws Exception { + doTest("idea/testData/formatter/SingleLineFunctionLiteral.after.kt"); + } + + @TestMetadata("SpaceAroundExtendColon.after.kt") + public void testSpaceAroundExtendColon() throws Exception { + doTest("idea/testData/formatter/SpaceAroundExtendColon.after.kt"); + } + + @TestMetadata("SpaceBeforeFunctionLiteral.after.kt") + public void testSpaceBeforeFunctionLiteral() throws Exception { + doTest("idea/testData/formatter/SpaceBeforeFunctionLiteral.after.kt"); + } + + @TestMetadata("SpacesAroundOperations.after.kt") + public void testSpacesAroundOperations() throws Exception { + doTest("idea/testData/formatter/SpacesAroundOperations.after.kt"); + } + + @TestMetadata("SpacesAroundUnaryOperations.after.kt") + public void testSpacesAroundUnaryOperations() throws Exception { + doTest("idea/testData/formatter/SpacesAroundUnaryOperations.after.kt"); + } + + @TestMetadata("UnnecessarySpacesInParametersLists.after.kt") + public void testUnnecessarySpacesInParametersLists() throws Exception { + doTest("idea/testData/formatter/UnnecessarySpacesInParametersLists.after.kt"); + } + + @TestMetadata("When.after.kt") + public void testWhen() throws Exception { + doTest("idea/testData/formatter/When.after.kt"); + } + + @TestMetadata("WhenArrow.after.kt") + public void testWhenArrow() throws Exception { + doTest("idea/testData/formatter/WhenArrow.after.kt"); + } + + @TestMetadata("WhenEntryExpr.after.kt") + public void testWhenEntryExpr() throws Exception { + doTest("idea/testData/formatter/WhenEntryExpr.after.kt"); + } + + @TestMetadata("WhenLinesBeforeLbrace.after.kt") + public void testWhenLinesBeforeLbrace() throws Exception { + doTest("idea/testData/formatter/WhenLinesBeforeLbrace.after.kt"); + } + + @TestMetadata("WhileSpacing.after.kt") + public void testWhileSpacing() throws Exception { + doTest("idea/testData/formatter/WhileSpacing.after.kt"); + } + + @TestMetadata("idea/testData/formatter/modifierList") + public static class ModifierList extends AbstractJetFormatterTest { + public void testAllFilesPresentInModifierList() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/formatter/modifierList"), Pattern.compile("^([^\\.]+)\\.after.kt$"), true); + } + + @TestMetadata("funAnnotationBeforeAnnotation.after.kt") + public void testFunAnnotationBeforeAnnotation() throws Exception { + doTest("idea/testData/formatter/modifierList/funAnnotationBeforeAnnotation.after.kt"); + } + + @TestMetadata("funAnnotationBeforeAnnotationEntry.after.kt") + public void testFunAnnotationBeforeAnnotationEntry() throws Exception { + doTest("idea/testData/formatter/modifierList/funAnnotationBeforeAnnotationEntry.after.kt"); + } + + @TestMetadata("funAnnotationBeforeModifiers.after.kt") + public void testFunAnnotationBeforeModifiers() throws Exception { + doTest("idea/testData/formatter/modifierList/funAnnotationBeforeModifiers.after.kt"); + } + + @TestMetadata("funAnnotationEntryBeforeAnnotation.after.kt") + public void testFunAnnotationEntryBeforeAnnotation() throws Exception { + doTest("idea/testData/formatter/modifierList/funAnnotationEntryBeforeAnnotation.after.kt"); + } + + @TestMetadata("funAnnotationEntryBeforeAnnotationEntry.after.kt") + public void testFunAnnotationEntryBeforeAnnotationEntry() throws Exception { + doTest("idea/testData/formatter/modifierList/funAnnotationEntryBeforeAnnotationEntry.after.kt"); + } + + @TestMetadata("funAnnotationEntryBeforeModifiers.after.kt") + public void testFunAnnotationEntryBeforeModifiers() throws Exception { + doTest("idea/testData/formatter/modifierList/funAnnotationEntryBeforeModifiers.after.kt"); + } + + @TestMetadata("funModifierBeforeAnnotation.after.kt") + public void testFunModifierBeforeAnnotation() throws Exception { + doTest("idea/testData/formatter/modifierList/funModifierBeforeAnnotation.after.kt"); + } + + @TestMetadata("funModifierBeforeAnnotationEntry.after.kt") + public void testFunModifierBeforeAnnotationEntry() throws Exception { + doTest("idea/testData/formatter/modifierList/funModifierBeforeAnnotationEntry.after.kt"); + } + + @TestMetadata("funModifierBeforeModifiers.after.kt") + public void testFunModifierBeforeModifiers() throws Exception { + doTest("idea/testData/formatter/modifierList/funModifierBeforeModifiers.after.kt"); + } + + @TestMetadata("funTheOnlyModifier.after.kt") + public void testFunTheOnlyModifier() throws Exception { + doTest("idea/testData/formatter/modifierList/funTheOnlyModifier.after.kt"); + } + + @TestMetadata("memberFunTheOnlyModifier.after.kt") + public void testMemberFunTheOnlyModifier() throws Exception { + doTest("idea/testData/formatter/modifierList/memberFunTheOnlyModifier.after.kt"); + } + + @TestMetadata("memberValTheOnlyModifier.after.kt") + public void testMemberValTheOnlyModifier() throws Exception { + doTest("idea/testData/formatter/modifierList/memberValTheOnlyModifier.after.kt"); + } + + @TestMetadata("memberVarTheOnlyModifier.after.kt") + public void testMemberVarTheOnlyModifier() throws Exception { + doTest("idea/testData/formatter/modifierList/memberVarTheOnlyModifier.after.kt"); + } + + @TestMetadata("secondMemberFunTheOnlyModifier.after.kt") + public void testSecondMemberFunTheOnlyModifier() throws Exception { + doTest("idea/testData/formatter/modifierList/secondMemberFunTheOnlyModifier.after.kt"); + } + + @TestMetadata("secondMemberValTheOnlyModifier.after.kt") + public void testSecondMemberValTheOnlyModifier() throws Exception { + doTest("idea/testData/formatter/modifierList/secondMemberValTheOnlyModifier.after.kt"); + } + + @TestMetadata("secondMemberVarTheOnlyModifier.after.kt") + public void testSecondMemberVarTheOnlyModifier() throws Exception { + doTest("idea/testData/formatter/modifierList/secondMemberVarTheOnlyModifier.after.kt"); + } + + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("Formatter"); + suite.addTestSuite(Formatter.class); + suite.addTestSuite(ModifierList.class); + return suite; + } + } + + @TestMetadata("idea/testData/formatter") + @InnerTestClasses({}) + public static class FormatterInverted extends AbstractJetFormatterTest { + public void testAllFilesPresentInFormatterInverted() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/formatter"), Pattern.compile("^([^\\.]+)\\.after.inv.kt$"), true); + } + + @TestMetadata("FunctionalType.after.inv.kt") + public void testFunctionalType() throws Exception { + doTestInverted("idea/testData/formatter/FunctionalType.after.inv.kt"); + } + + @TestMetadata("IfElseWithTrickyComments.after.inv.kt") + public void testIfElseWithTrickyComments() throws Exception { + doTestInverted("idea/testData/formatter/IfElseWithTrickyComments.after.inv.kt"); + } + + @TestMetadata("LambdaArrow.after.inv.kt") + public void testLambdaArrow() throws Exception { + doTestInverted("idea/testData/formatter/LambdaArrow.after.inv.kt"); + } + + @TestMetadata("MultilineFunctionLiteralWithParams.after.inv.kt") + public void testMultilineFunctionLiteralWithParams() throws Exception { + doTestInverted("idea/testData/formatter/MultilineFunctionLiteralWithParams.after.inv.kt"); + } + + @TestMetadata("Parameters.after.inv.kt") + public void testParameters() throws Exception { + doTestInverted("idea/testData/formatter/Parameters.after.inv.kt"); + } + + @TestMetadata("RightBracketOnNewLine.after.inv.kt") + public void testRightBracketOnNewLine() throws Exception { + doTestInverted("idea/testData/formatter/RightBracketOnNewLine.after.inv.kt"); + } + + @TestMetadata("SingleLineFunctionLiteral.after.inv.kt") + public void testSingleLineFunctionLiteral() throws Exception { + doTestInverted("idea/testData/formatter/SingleLineFunctionLiteral.after.inv.kt"); + } + + @TestMetadata("SpaceAroundExtendColon.after.inv.kt") + public void testSpaceAroundExtendColon() throws Exception { + doTestInverted("idea/testData/formatter/SpaceAroundExtendColon.after.inv.kt"); + } + + @TestMetadata("SpacesAroundOperations.after.inv.kt") + public void testSpacesAroundOperations() throws Exception { + doTestInverted("idea/testData/formatter/SpacesAroundOperations.after.inv.kt"); + } + + @TestMetadata("SpacesAroundUnaryOperations.after.inv.kt") + public void testSpacesAroundUnaryOperations() throws Exception { + doTestInverted("idea/testData/formatter/SpacesAroundUnaryOperations.after.inv.kt"); + } + + @TestMetadata("When.after.inv.kt") + public void testWhen() throws Exception { + doTestInverted("idea/testData/formatter/When.after.inv.kt"); + } + + @TestMetadata("WhenArrow.after.inv.kt") + public void testWhenArrow() throws Exception { + doTestInverted("idea/testData/formatter/WhenArrow.after.inv.kt"); + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("FormatterInverted"); + suite.addTestSuite(FormatterInverted.class); + return suite; + } } public static Test suite() { TestSuite suite = new TestSuite("JetFormatterTestGenerated"); - suite.addTestSuite(JetFormatterTestGenerated.class); - suite.addTestSuite(ModifierList.class); + suite.addTest(Formatter.innerSuite()); + suite.addTest(FormatterInverted.innerSuite()); return suite; } }