diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiUtil.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiUtil.java index cf562e674ad..73364aa0f56 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiUtil.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiUtil.java @@ -20,8 +20,10 @@ import com.google.common.base.Function; import com.google.common.base.Predicate; import com.google.common.collect.Lists; import com.intellij.lang.ASTNode; +import com.intellij.psi.PsiComment; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; +import com.intellij.psi.PsiWhiteSpace; import com.intellij.psi.impl.CheckUtil; import com.intellij.psi.impl.source.codeStyle.CodeEditUtil; import com.intellij.psi.tree.IElementType; @@ -691,6 +693,10 @@ public class JetPsiUtil { return (elseCount == 1); } + public static PsiElement skipTrailingWhitespacesAndComments(PsiElement element) { + return PsiTreeUtil.skipSiblingsForward(element, PsiWhiteSpace.class, PsiComment.class); + } + public static final Predicate ANY_JET_ELEMENT = new Predicate() { @Override public boolean apply(@Nullable JetElement input) { diff --git a/idea/src/org/jetbrains/jet/plugin/codeInsight/codeTransformations/branchedTransformations/BranchedFoldingUtils.java b/idea/src/org/jetbrains/jet/plugin/codeInsight/codeTransformations/branchedTransformations/BranchedFoldingUtils.java index 6dcb9f378cc..d8511964c4f 100644 --- a/idea/src/org/jetbrains/jet/plugin/codeInsight/codeTransformations/branchedTransformations/BranchedFoldingUtils.java +++ b/idea/src/org/jetbrains/jet/plugin/codeInsight/codeTransformations/branchedTransformations/BranchedFoldingUtils.java @@ -19,8 +19,6 @@ package org.jetbrains.jet.plugin.codeInsight.codeTransformations.branchedTransfo import com.google.common.base.Predicate; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiWhiteSpace; -import com.intellij.psi.util.PsiTreeUtil; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.lang.psi.*; @@ -136,7 +134,7 @@ public class BranchedFoldingUtils { return false; } - PsiElement nextElement = PsiTreeUtil.skipSiblingsForward(ifExpression, PsiWhiteSpace.class); + PsiElement nextElement = JetPsiUtil.skipTrailingWhitespacesAndComments(ifExpression); return (nextElement instanceof JetExpression) && checkAndGetFoldableBranchedReturn((JetExpression)nextElement) != null; } @@ -218,7 +216,7 @@ public class BranchedFoldingUtils { JetExpression condition = ifExpression.getCondition(); JetExpression thenRoot = ifExpression.getThen(); - JetExpression elseRoot = (JetExpression)PsiTreeUtil.skipSiblingsForward(ifExpression, PsiWhiteSpace.class); + JetExpression elseRoot = (JetExpression)JetPsiUtil.skipTrailingWhitespacesAndComments(ifExpression); assert condition != null; assert thenRoot != null; @@ -228,7 +226,7 @@ public class BranchedFoldingUtils { JetReturnExpression newReturnExpr = JetPsiFactory.createReturn(project, newIfExpr); newReturnExpr = (JetReturnExpression) ifExpression.replace(newReturnExpr); - JetReturnExpression oldReturn = (JetReturnExpression)PsiTreeUtil.skipSiblingsForward(newReturnExpr, PsiWhiteSpace.class); + JetReturnExpression oldReturn = (JetReturnExpression)JetPsiUtil.skipTrailingWhitespacesAndComments(newReturnExpr); assert oldReturn != null; diff --git a/idea/testData/codeInsight/codeTransformations/branched/folding/asymmetricReturn/simpleIfWithComments.kt b/idea/testData/codeInsight/codeTransformations/branched/folding/asymmetricReturn/simpleIfWithComments.kt new file mode 100644 index 00000000000..7c1e5e55c0c --- /dev/null +++ b/idea/testData/codeInsight/codeTransformations/branched/folding/asymmetricReturn/simpleIfWithComments.kt @@ -0,0 +1,5 @@ +fun test(n: Int): String { + if (n == 1) return "one" + // comment + return "two" +} \ No newline at end of file diff --git a/idea/testData/codeInsight/codeTransformations/branched/folding/asymmetricReturn/simpleIfWithComments.kt.after b/idea/testData/codeInsight/codeTransformations/branched/folding/asymmetricReturn/simpleIfWithComments.kt.after new file mode 100644 index 00000000000..83a9dbff5da --- /dev/null +++ b/idea/testData/codeInsight/codeTransformations/branched/folding/asymmetricReturn/simpleIfWithComments.kt.after @@ -0,0 +1,4 @@ +fun test(n: Int): String { + return if (n == 1) "one" else "two" + // comment +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/jet/plugin/codeInsight/codeTransformations/CodeTransformationsTestGenerated.java b/idea/tests/org/jetbrains/jet/plugin/codeInsight/codeTransformations/CodeTransformationsTestGenerated.java index fb13ee13277..573c6bdaa89 100644 --- a/idea/tests/org/jetbrains/jet/plugin/codeInsight/codeTransformations/CodeTransformationsTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/plugin/codeInsight/codeTransformations/CodeTransformationsTestGenerated.java @@ -30,142 +30,250 @@ import org.jetbrains.jet.plugin.codeInsight.codeTransformations.AbstractCodeTran /** This class is generated by {@link org.jetbrains.jet.generators.tests.GenerateTests}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") -@InnerTestClasses({CodeTransformationsTestGenerated.IfStatementWithAssignmentsToExpression.class, CodeTransformationsTestGenerated.AssignmentWithIfExpressionToStatement.class}) +@InnerTestClasses({CodeTransformationsTestGenerated.Folding.class, CodeTransformationsTestGenerated.Unfolding.class}) public class CodeTransformationsTestGenerated extends AbstractCodeTransformationTest { - @TestMetadata("idea/testData/codeInsight/codeTransformations/ifStatementWithAssignmentsToExpression") - public static class IfStatementWithAssignmentsToExpression extends AbstractCodeTransformationTest { - public void testAllFilesPresentInIfStatementWithAssignmentsToExpression() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/codeTransformations/ifStatementWithAssignmentsToExpression"), Pattern.compile("^(.+)\\.kt$"), true); + @TestMetadata("idea/testData/codeInsight/codeTransformations/branched/folding") + @InnerTestClasses({Folding.Assignment.class, Folding.AsymmetricReturn.class, Folding.Return.class}) + public static class Folding extends AbstractCodeTransformationTest { + public void testAllFilesPresentInFolding() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/codeTransformations/branched/folding"), Pattern.compile("^(.+)\\.kt$"), true); } - @TestMetadata("innerIfTransformed.kt") - public void testInnerIfTransformed() throws Exception { - doTestIfStatementWithAssignmentsToExpression("idea/testData/codeInsight/codeTransformations/ifStatementWithAssignmentsToExpression/innerIfTransformed.kt"); + @TestMetadata("idea/testData/codeInsight/codeTransformations/branched/folding/assignment") + public static class Assignment extends AbstractCodeTransformationTest { + public void testAllFilesPresentInAssignment() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/codeTransformations/branched/folding/assignment"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("innerIfTransformed.kt") + public void testInnerIfTransformed() throws Exception { + doTestBranchedFolding("idea/testData/codeInsight/codeTransformations/branched/folding/assignment/innerIfTransformed.kt"); + } + + @TestMetadata("innerWhenTransformed.kt") + public void testInnerWhenTransformed() throws Exception { + doTestBranchedFolding("idea/testData/codeInsight/codeTransformations/branched/folding/assignment/innerWhenTransformed.kt"); + } + + @TestMetadata("simpleIf.kt") + public void testSimpleIf() throws Exception { + doTestBranchedFolding("idea/testData/codeInsight/codeTransformations/branched/folding/assignment/simpleIf.kt"); + } + + @TestMetadata("simpleIfWithAugmentedAssignment.kt") + public void testSimpleIfWithAugmentedAssignment() throws Exception { + doTestBranchedFolding("idea/testData/codeInsight/codeTransformations/branched/folding/assignment/simpleIfWithAugmentedAssignment.kt"); + } + + @TestMetadata("simpleIfWithBlocks.kt") + public void testSimpleIfWithBlocks() throws Exception { + doTestBranchedFolding("idea/testData/codeInsight/codeTransformations/branched/folding/assignment/simpleIfWithBlocks.kt"); + } + + @TestMetadata("simpleIfWithShadowedVar.kt") + public void testSimpleIfWithShadowedVar() throws Exception { + doTestBranchedFolding("idea/testData/codeInsight/codeTransformations/branched/folding/assignment/simpleIfWithShadowedVar.kt"); + } + + @TestMetadata("simpleIfWithUnmatchedAssignmentOps.kt") + public void testSimpleIfWithUnmatchedAssignmentOps() throws Exception { + doTestBranchedFolding("idea/testData/codeInsight/codeTransformations/branched/folding/assignment/simpleIfWithUnmatchedAssignmentOps.kt"); + } + + @TestMetadata("simpleIfWithUnmatchedAssignments.kt") + public void testSimpleIfWithUnmatchedAssignments() throws Exception { + doTestBranchedFolding("idea/testData/codeInsight/codeTransformations/branched/folding/assignment/simpleIfWithUnmatchedAssignments.kt"); + } + + @TestMetadata("simpleIfWithoutElse.kt") + public void testSimpleIfWithoutElse() throws Exception { + doTestBranchedFolding("idea/testData/codeInsight/codeTransformations/branched/folding/assignment/simpleIfWithoutElse.kt"); + } + + @TestMetadata("simpleIfWithoutTerminatingAssignment.kt") + public void testSimpleIfWithoutTerminatingAssignment() throws Exception { + doTestBranchedFolding("idea/testData/codeInsight/codeTransformations/branched/folding/assignment/simpleIfWithoutTerminatingAssignment.kt"); + } + + @TestMetadata("simpleWhen.kt") + public void testSimpleWhen() throws Exception { + doTestBranchedFolding("idea/testData/codeInsight/codeTransformations/branched/folding/assignment/simpleWhen.kt"); + } + + @TestMetadata("simpleWhenWithBlocks.kt") + public void testSimpleWhenWithBlocks() throws Exception { + doTestBranchedFolding("idea/testData/codeInsight/codeTransformations/branched/folding/assignment/simpleWhenWithBlocks.kt"); + } + + @TestMetadata("simpleWhenWithShadowedVar.kt") + public void testSimpleWhenWithShadowedVar() throws Exception { + doTestBranchedFolding("idea/testData/codeInsight/codeTransformations/branched/folding/assignment/simpleWhenWithShadowedVar.kt"); + } + + @TestMetadata("simpleWhenWithUnmatchedAssignments.kt") + public void testSimpleWhenWithUnmatchedAssignments() throws Exception { + doTestBranchedFolding("idea/testData/codeInsight/codeTransformations/branched/folding/assignment/simpleWhenWithUnmatchedAssignments.kt"); + } + + @TestMetadata("simpleWhenWithoutTerminatingAssignment.kt") + public void testSimpleWhenWithoutTerminatingAssignment() throws Exception { + doTestBranchedFolding("idea/testData/codeInsight/codeTransformations/branched/folding/assignment/simpleWhenWithoutTerminatingAssignment.kt"); + } + } - @TestMetadata("nestedIfs.kt") - public void testNestedIfs() throws Exception { - doTestIfStatementWithAssignmentsToExpression("idea/testData/codeInsight/codeTransformations/ifStatementWithAssignmentsToExpression/nestedIfs.kt"); + @TestMetadata("idea/testData/codeInsight/codeTransformations/branched/folding/asymmetricReturn") + public static class AsymmetricReturn extends AbstractCodeTransformationTest { + public void testAllFilesPresentInAsymmetricReturn() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/codeTransformations/branched/folding/asymmetricReturn"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("simpleIf.kt") + public void testSimpleIf() throws Exception { + doTestBranchedFolding("idea/testData/codeInsight/codeTransformations/branched/folding/asymmetricReturn/simpleIf.kt"); + } + + @TestMetadata("simpleIfWithBlocks.kt") + public void testSimpleIfWithBlocks() throws Exception { + doTestBranchedFolding("idea/testData/codeInsight/codeTransformations/branched/folding/asymmetricReturn/simpleIfWithBlocks.kt"); + } + + @TestMetadata("simpleIfWithComments.kt") + public void testSimpleIfWithComments() throws Exception { + doTestBranchedFolding("idea/testData/codeInsight/codeTransformations/branched/folding/asymmetricReturn/simpleIfWithComments.kt"); + } + } - @TestMetadata("simpleIf.kt") - public void testSimpleIf() throws Exception { - doTestIfStatementWithAssignmentsToExpression("idea/testData/codeInsight/codeTransformations/ifStatementWithAssignmentsToExpression/simpleIf.kt"); + @TestMetadata("idea/testData/codeInsight/codeTransformations/branched/folding/return") + public static class Return extends AbstractCodeTransformationTest { + public void testAllFilesPresentInReturn() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/codeTransformations/branched/folding/return"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("innerIfTransformed.kt") + public void testInnerIfTransformed() throws Exception { + doTestBranchedFolding("idea/testData/codeInsight/codeTransformations/branched/folding/return/innerIfTransformed.kt"); + } + + @TestMetadata("innerWhenTransformed.kt") + public void testInnerWhenTransformed() throws Exception { + doTestBranchedFolding("idea/testData/codeInsight/codeTransformations/branched/folding/return/innerWhenTransformed.kt"); + } + + @TestMetadata("simpleIf.kt") + public void testSimpleIf() throws Exception { + doTestBranchedFolding("idea/testData/codeInsight/codeTransformations/branched/folding/return/simpleIf.kt"); + } + + @TestMetadata("simpleIfWithBlocks.kt") + public void testSimpleIfWithBlocks() throws Exception { + doTestBranchedFolding("idea/testData/codeInsight/codeTransformations/branched/folding/return/simpleIfWithBlocks.kt"); + } + + @TestMetadata("simpleWhen.kt") + public void testSimpleWhen() throws Exception { + doTestBranchedFolding("idea/testData/codeInsight/codeTransformations/branched/folding/return/simpleWhen.kt"); + } + + @TestMetadata("simpleWhenWithBlocks.kt") + public void testSimpleWhenWithBlocks() throws Exception { + doTestBranchedFolding("idea/testData/codeInsight/codeTransformations/branched/folding/return/simpleWhenWithBlocks.kt"); + } + } - @TestMetadata("simpleIfWithoutElse.kt") - public void testSimpleIfWithoutElse() throws Exception { - doTestIfStatementWithAssignmentsToExpression("idea/testData/codeInsight/codeTransformations/ifStatementWithAssignmentsToExpression/simpleIfWithoutElse.kt"); + public static Test innerSuite() { + TestSuite suite = new TestSuite("Folding"); + suite.addTestSuite(Folding.class); + suite.addTestSuite(Assignment.class); + suite.addTestSuite(AsymmetricReturn.class); + suite.addTestSuite(Return.class); + return suite; } - - @TestMetadata("simpleIfWithoutTerminatingAssignment.kt") - public void testSimpleIfWithoutTerminatingAssignment() throws Exception { - doTestIfStatementWithAssignmentsToExpression("idea/testData/codeInsight/codeTransformations/ifStatementWithAssignmentsToExpression/simpleIfWithoutTerminatingAssignment.kt"); - } - } - @TestMetadata("idea/testData/codeInsight/codeTransformations/assignmentWithIfExpressionToStatement") - public static class AssignmentWithIfExpressionToStatement extends AbstractCodeTransformationTest { - public void testAllFilesPresentInAssignmentWithIfExpressionToStatement() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/codeTransformations/assignmentWithIfExpressionToStatement"), Pattern.compile("^(.+)\\.kt$"), true); + @TestMetadata("idea/testData/codeInsight/codeTransformations/branched/unfolding") + @InnerTestClasses({Unfolding.Assignment.class, Unfolding.Return.class}) + public static class Unfolding extends AbstractCodeTransformationTest { + public void testAllFilesPresentInUnfolding() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/codeTransformations/branched/unfolding"), Pattern.compile("^(.+)\\.kt$"), true); } - @TestMetadata("innerIfTransformed.kt") - public void testInnerIfTransformed() throws Exception { - doTestAssignmentWithIfExpressionToStatement("idea/testData/codeInsight/codeTransformations/assignmentWithIfExpressionToStatement/innerIfTransformed.kt"); + @TestMetadata("idea/testData/codeInsight/codeTransformations/branched/unfolding/assignment") + public static class Assignment extends AbstractCodeTransformationTest { + public void testAllFilesPresentInAssignment() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/codeTransformations/branched/unfolding/assignment"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("innerIfTransformed.kt") + public void testInnerIfTransformed() throws Exception { + doTestBranchedUnfolding("idea/testData/codeInsight/codeTransformations/branched/unfolding/assignment/innerIfTransformed.kt"); + } + + @TestMetadata("nestedIfs.kt") + public void testNestedIfs() throws Exception { + doTestBranchedUnfolding("idea/testData/codeInsight/codeTransformations/branched/unfolding/assignment/nestedIfs.kt"); + } + + @TestMetadata("simpleIf.kt") + public void testSimpleIf() throws Exception { + doTestBranchedUnfolding("idea/testData/codeInsight/codeTransformations/branched/unfolding/assignment/simpleIf.kt"); + } + + @TestMetadata("simpleIfWithAugmentedAssignment.kt") + public void testSimpleIfWithAugmentedAssignment() throws Exception { + doTestBranchedUnfolding("idea/testData/codeInsight/codeTransformations/branched/unfolding/assignment/simpleIfWithAugmentedAssignment.kt"); + } + + @TestMetadata("simpleIfWithBlocks.kt") + public void testSimpleIfWithBlocks() throws Exception { + doTestBranchedUnfolding("idea/testData/codeInsight/codeTransformations/branched/unfolding/assignment/simpleIfWithBlocks.kt"); + } + + @TestMetadata("simpleIfWithoutAssignment.kt") + public void testSimpleIfWithoutAssignment() throws Exception { + doTestBranchedUnfolding("idea/testData/codeInsight/codeTransformations/branched/unfolding/assignment/simpleIfWithoutAssignment.kt"); + } + } - @TestMetadata("nestedIfs.kt") - public void testNestedIfs() throws Exception { - doTestAssignmentWithIfExpressionToStatement("idea/testData/codeInsight/codeTransformations/assignmentWithIfExpressionToStatement/nestedIfs.kt"); + @TestMetadata("idea/testData/codeInsight/codeTransformations/branched/unfolding/return") + public static class Return extends AbstractCodeTransformationTest { + public void testAllFilesPresentInReturn() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/codeTransformations/branched/unfolding/return"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("innerIfTransformed.kt") + public void testInnerIfTransformed() throws Exception { + doTestBranchedUnfolding("idea/testData/codeInsight/codeTransformations/branched/unfolding/return/innerIfTransformed.kt"); + } + + @TestMetadata("simpleIf.kt") + public void testSimpleIf() throws Exception { + doTestBranchedUnfolding("idea/testData/codeInsight/codeTransformations/branched/unfolding/return/simpleIf.kt"); + } + + @TestMetadata("simpleIfWithBlocks.kt") + public void testSimpleIfWithBlocks() throws Exception { + doTestBranchedUnfolding("idea/testData/codeInsight/codeTransformations/branched/unfolding/return/simpleIfWithBlocks.kt"); + } + } - @TestMetadata("simpleIf.kt") - public void testSimpleIf() throws Exception { - doTestAssignmentWithIfExpressionToStatement("idea/testData/codeInsight/codeTransformations/assignmentWithIfExpressionToStatement/simpleIf.kt"); + public static Test innerSuite() { + TestSuite suite = new TestSuite("Unfolding"); + suite.addTestSuite(Unfolding.class); + suite.addTestSuite(Assignment.class); + suite.addTestSuite(Return.class); + return suite; } - - @TestMetadata("simpleIfWithoutAssignment.kt") - public void testSimpleIfWithoutAssignment() throws Exception { - doTestAssignmentWithIfExpressionToStatement("idea/testData/codeInsight/codeTransformations/assignmentWithIfExpressionToStatement/simpleIfWithoutAssignment.kt"); - } - - } - - @TestMetadata("idea/testData/codeInsight/codeTransformations/removeUnnecessaryParentheses") - public static class RemoveUnnecessaryParentheses extends AbstractCodeTransformationTest { - public void testAllFilesPresentInRemoveUnnecessaryParentheses() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/codeInsight/codeTransformations/removeUnnecessaryParentheses"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("necessaryParentheses1.kt") - public void testNecessaryParentheses1() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/codeInsight/codeTransformations/removeUnnecessaryParentheses/necessaryParentheses1.kt"); - } - - @TestMetadata("necessaryParentheses2.kt") - public void testNecessaryParentheses2() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/codeInsight/codeTransformations/removeUnnecessaryParentheses/necessaryParentheses2.kt"); - } - - @TestMetadata("necessaryParentheses3.kt") - public void testNecessaryParentheses3() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/codeInsight/codeTransformations/removeUnnecessaryParentheses/necessaryParentheses3.kt"); - } - - @TestMetadata("necessaryParentheses4.kt") - public void testNecessaryParentheses4() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/codeInsight/codeTransformations/removeUnnecessaryParentheses/necessaryParentheses4.kt"); - } - - @TestMetadata("necessaryParentheses5.kt") - public void testNecessaryParentheses5() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/codeInsight/codeTransformations/removeUnnecessaryParentheses/necessaryParentheses5.kt"); - } - - @TestMetadata("unnecessaryParentheses1.kt") - public void testUnnecessaryParentheses1() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/codeInsight/codeTransformations/removeUnnecessaryParentheses/unnecessaryParentheses1.kt"); - } - - @TestMetadata("unnecessaryParentheses2.kt") - public void testUnnecessaryParentheses2() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/codeInsight/codeTransformations/removeUnnecessaryParentheses/unnecessaryParentheses2.kt"); - } - - @TestMetadata("unnecessaryParentheses3.kt") - public void testUnnecessaryParentheses3() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/codeInsight/codeTransformations/removeUnnecessaryParentheses/unnecessaryParentheses3.kt"); - } - - @TestMetadata("unnecessaryParentheses4.kt") - public void testUnnecessaryParentheses4() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/codeInsight/codeTransformations/removeUnnecessaryParentheses/unnecessaryParentheses4.kt"); - } - - @TestMetadata("unnecessaryParentheses5.kt") - public void testUnnecessaryParentheses5() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/codeInsight/codeTransformations/removeUnnecessaryParentheses/unnecessaryParentheses5.kt"); - } - - @TestMetadata("unnecessaryParentheses6.kt") - public void testUnnecessaryParentheses6() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/codeInsight/codeTransformations/removeUnnecessaryParentheses/unnecessaryParentheses6.kt"); - } - - @TestMetadata("unnecessaryParentheses7.kt") - public void testUnnecessaryParentheses7() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/codeInsight/codeTransformations/removeUnnecessaryParentheses/unnecessaryParentheses7.kt"); - } - } public static Test suite() { TestSuite suite = new TestSuite("CodeTransformationsTestGenerated"); - suite.addTestSuite(IfStatementWithAssignmentsToExpression.class); - suite.addTestSuite(AssignmentWithIfExpressionToStatement.class); - suite.addTestSuite(RemoveUnnecessaryParentheses.class); + suite.addTest(Folding.innerSuite()); + suite.addTest(Unfolding.innerSuite()); return suite; } }