From 15364ceae6dcff7259000b938bb1828f2ec4678a Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Wed, 26 Mar 2014 20:37:04 +0400 Subject: [PATCH] Fix bug in test generation (as introduced by earlier commit) --- .../jet/generators/tests/GenerateTests.kt | 6 +- .../CodeTransformationTestGenerated.java | 228 +++++++++++++++++- 2 files changed, 225 insertions(+), 9 deletions(-) diff --git a/generators/src/org/jetbrains/jet/generators/tests/GenerateTests.kt b/generators/src/org/jetbrains/jet/generators/tests/GenerateTests.kt index 8f0f6298bdd..3d1731ce731 100644 --- a/generators/src/org/jetbrains/jet/generators/tests/GenerateTests.kt +++ b/generators/src/org/jetbrains/jet/generators/tests/GenerateTests.kt @@ -380,13 +380,13 @@ fun main(args: Array) { model("intentions/attributeCallReplacements/replaceUnaryPrefixIntention", testMethod = "doTestReplaceUnaryPrefixIntention") model("intentions/attributeCallReplacements/replaceInvokeIntention", testMethod = "doTestReplaceInvokeIntention") model("intentions/simplifyNegatedBinaryExpressionIntention", testMethod = "doTestSimplifyNegatedBinaryExpressionIntention") + model("intentions/convertNegatedBooleanSequence", testMethod="doTestConvertNegatedBooleanSequence") + model("intentions/convertNegatedExpressionWithDemorgansLaw", testMethod = "doTestConvertNegatedExpressionWithDemorgansLaw") + model("intentions/swapBinaryExpression", testMethod = "doTestSwapBinaryExpression") } testClass(javaClass()) { model("codeInsight/inspections", extension = null, recursive = false) - model("intentions/convertNegatedBooleanSequence", testMethod="doTestConvertNegatedBooleanSequence") - model("intentions/convertNegatedExpressionWithDemorgansLaw", testMethod = "doTestConvertNegatedExpressionWithDemorgansLaw") - model("intentions/swapBinaryExpression", testMethod = "doTestSwapBinaryExpression") } testClass(javaClass()) { diff --git a/idea/tests/org/jetbrains/jet/plugin/intentions/CodeTransformationTestGenerated.java b/idea/tests/org/jetbrains/jet/plugin/intentions/CodeTransformationTestGenerated.java index 61ea05d1596..f03d6b2f039 100644 --- a/idea/tests/org/jetbrains/jet/plugin/intentions/CodeTransformationTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/plugin/intentions/CodeTransformationTestGenerated.java @@ -16,21 +16,18 @@ package org.jetbrains.jet.plugin.intentions; -import junit.framework.Assert; import junit.framework.Test; import junit.framework.TestSuite; - -import java.io.File; -import java.util.regex.Pattern; import org.jetbrains.jet.JetTestUtils; import org.jetbrains.jet.test.InnerTestClasses; import org.jetbrains.jet.test.TestMetadata; -import org.jetbrains.jet.plugin.intentions.AbstractCodeTransformationTest; +import java.io.File; +import java.util.regex.Pattern; /** This class is generated by {@link org.jetbrains.jet.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") -@InnerTestClasses({CodeTransformationTestGenerated.ElvisToIfThen.class, CodeTransformationTestGenerated.IfThenToElvis.class, CodeTransformationTestGenerated.SafeAccessToIfThen.class, CodeTransformationTestGenerated.IfThenToSafeAccess.class, CodeTransformationTestGenerated.IfToAssignment.class, CodeTransformationTestGenerated.IfToReturn.class, CodeTransformationTestGenerated.IfToReturnAsymmetrically.class, CodeTransformationTestGenerated.WhenToAssignment.class, CodeTransformationTestGenerated.WhenToReturn.class, CodeTransformationTestGenerated.AssignmentToIf.class, CodeTransformationTestGenerated.AssignmentToWhen.class, CodeTransformationTestGenerated.PropertyToIf.class, CodeTransformationTestGenerated.PropertyToWhen.class, CodeTransformationTestGenerated.ReturnToIf.class, CodeTransformationTestGenerated.ReturnToWhen.class, CodeTransformationTestGenerated.IfToWhen.class, CodeTransformationTestGenerated.WhenToIf.class, CodeTransformationTestGenerated.Flatten.class, CodeTransformationTestGenerated.Merge.class, CodeTransformationTestGenerated.IntroduceSubject.class, CodeTransformationTestGenerated.EliminateSubject.class, CodeTransformationTestGenerated.Split.class, CodeTransformationTestGenerated.Join.class, CodeTransformationTestGenerated.ConvertMemberToExtension.class, CodeTransformationTestGenerated.ReconstructedType.class, CodeTransformationTestGenerated.RemoveUnnecessaryParentheses.class, CodeTransformationTestGenerated.ReplaceWithDotQualifiedMethodCall.class, CodeTransformationTestGenerated.ReplaceWithInfixFunctionCall.class, CodeTransformationTestGenerated.RemoveCurlyBracesFromTemplate.class, CodeTransformationTestGenerated.MoveLambdaInsideParentheses.class, CodeTransformationTestGenerated.MoveLambdaOutsideParentheses.class, CodeTransformationTestGenerated.ReplaceExplicitFunctionLiteralParamWithIt.class, CodeTransformationTestGenerated.ReplaceItWithExplicitFunctionLiteralParam.class, CodeTransformationTestGenerated.RemoveBraces.class, CodeTransformationTestGenerated.AddBraces.class, CodeTransformationTestGenerated.ReplaceGetIntention.class, CodeTransformationTestGenerated.ReplaceContainsIntention.class, CodeTransformationTestGenerated.ReplaceBinaryInfixIntention.class, CodeTransformationTestGenerated.ReplaceUnaryPrefixIntention.class, CodeTransformationTestGenerated.ReplaceInvokeIntention.class, CodeTransformationTestGenerated.SimplifyNegatedBinaryExpressionIntention.class, CodeTransformationTestGenerated.ConvertNegatedBooleanSequence.class, CodeTransformationTestGenerated.ConvertNegatedExpressionWithDemorgansLaw.class}) +@InnerTestClasses({CodeTransformationTestGenerated.ElvisToIfThen.class, CodeTransformationTestGenerated.IfThenToElvis.class, CodeTransformationTestGenerated.SafeAccessToIfThen.class, CodeTransformationTestGenerated.IfThenToSafeAccess.class, CodeTransformationTestGenerated.IfToAssignment.class, CodeTransformationTestGenerated.IfToReturn.class, CodeTransformationTestGenerated.IfToReturnAsymmetrically.class, CodeTransformationTestGenerated.WhenToAssignment.class, CodeTransformationTestGenerated.WhenToReturn.class, CodeTransformationTestGenerated.AssignmentToIf.class, CodeTransformationTestGenerated.AssignmentToWhen.class, CodeTransformationTestGenerated.PropertyToIf.class, CodeTransformationTestGenerated.PropertyToWhen.class, CodeTransformationTestGenerated.ReturnToIf.class, CodeTransformationTestGenerated.ReturnToWhen.class, CodeTransformationTestGenerated.IfToWhen.class, CodeTransformationTestGenerated.WhenToIf.class, CodeTransformationTestGenerated.Flatten.class, CodeTransformationTestGenerated.Merge.class, CodeTransformationTestGenerated.IntroduceSubject.class, CodeTransformationTestGenerated.EliminateSubject.class, CodeTransformationTestGenerated.Split.class, CodeTransformationTestGenerated.Join.class, CodeTransformationTestGenerated.ConvertMemberToExtension.class, CodeTransformationTestGenerated.ReconstructedType.class, CodeTransformationTestGenerated.RemoveUnnecessaryParentheses.class, CodeTransformationTestGenerated.ReplaceWithDotQualifiedMethodCall.class, CodeTransformationTestGenerated.ReplaceWithInfixFunctionCall.class, CodeTransformationTestGenerated.RemoveCurlyBracesFromTemplate.class, CodeTransformationTestGenerated.MoveLambdaInsideParentheses.class, CodeTransformationTestGenerated.MoveLambdaOutsideParentheses.class, CodeTransformationTestGenerated.ReplaceExplicitFunctionLiteralParamWithIt.class, CodeTransformationTestGenerated.ReplaceItWithExplicitFunctionLiteralParam.class, CodeTransformationTestGenerated.RemoveBraces.class, CodeTransformationTestGenerated.AddBraces.class, CodeTransformationTestGenerated.ReplaceGetIntention.class, CodeTransformationTestGenerated.ReplaceContainsIntention.class, CodeTransformationTestGenerated.ReplaceBinaryInfixIntention.class, CodeTransformationTestGenerated.ReplaceUnaryPrefixIntention.class, CodeTransformationTestGenerated.ReplaceInvokeIntention.class, CodeTransformationTestGenerated.SimplifyNegatedBinaryExpressionIntention.class, CodeTransformationTestGenerated.ConvertNegatedBooleanSequence.class, CodeTransformationTestGenerated.ConvertNegatedExpressionWithDemorgansLaw.class, CodeTransformationTestGenerated.SwapBinaryExpression.class}) public class CodeTransformationTestGenerated extends AbstractCodeTransformationTest { @TestMetadata("idea/testData/intentions/branched/elvisToIfThen") public static class ElvisToIfThen extends AbstractCodeTransformationTest { @@ -2791,6 +2788,224 @@ public class CodeTransformationTestGenerated extends AbstractCodeTransformationT } + @TestMetadata("idea/testData/intentions/swapBinaryExpression") + public static class SwapBinaryExpression extends AbstractCodeTransformationTest { + public void testAllFilesPresentInSwapBinaryExpression() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/swapBinaryExpression"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("compareTo.kt") + public void testCompareTo() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/compareTo.kt"); + } + + @TestMetadata("conjunction.kt") + public void testConjunction() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/conjunction.kt"); + } + + @TestMetadata("conjunctionLiteral.kt") + public void testConjunctionLiteral() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/conjunctionLiteral.kt"); + } + + @TestMetadata("disjunction.kt") + public void testDisjunction() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/disjunction.kt"); + } + + @TestMetadata("disjunctionLiteral.kt") + public void testDisjunctionLiteral() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/disjunctionLiteral.kt"); + } + + @TestMetadata("divide.kt") + public void testDivide() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/divide.kt"); + } + + @TestMetadata("divideAssign.kt") + public void testDivideAssign() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/divideAssign.kt"); + } + + @TestMetadata("divideLiteral.kt") + public void testDivideLiteral() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/divideLiteral.kt"); + } + + @TestMetadata("doubleEquals.kt") + public void testDoubleEquals() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/doubleEquals.kt"); + } + + @TestMetadata("equals.kt") + public void testEquals() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/equals.kt"); + } + + @TestMetadata("equalsLiteral.kt") + public void testEqualsLiteral() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/equalsLiteral.kt"); + } + + @TestMetadata("greaterThan.kt") + public void testGreaterThan() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/greaterThan.kt"); + } + + @TestMetadata("greaterThanEquals.kt") + public void testGreaterThanEquals() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/greaterThanEquals.kt"); + } + + @TestMetadata("in.kt") + public void testIn() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/in.kt"); + } + + @TestMetadata("infixFunction.kt") + public void testInfixFunction() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/infixFunction.kt"); + } + + @TestMetadata("is.kt") + public void testIs() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/is.kt"); + } + + @TestMetadata("lessThan.kt") + public void testLessThan() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/lessThan.kt"); + } + + @TestMetadata("lessThanEquals.kt") + public void testLessThanEquals() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/lessThanEquals.kt"); + } + + @TestMetadata("minus.kt") + public void testMinus() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/minus.kt"); + } + + @TestMetadata("minusAssign.kt") + public void testMinusAssign() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/minusAssign.kt"); + } + + @TestMetadata("minusLiteral.kt") + public void testMinusLiteral() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/minusLiteral.kt"); + } + + @TestMetadata("multipleOperands.kt") + public void testMultipleOperands() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/multipleOperands.kt"); + } + + @TestMetadata("multiply.kt") + public void testMultiply() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/multiply.kt"); + } + + @TestMetadata("multiplyAssign.kt") + public void testMultiplyAssign() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/multiplyAssign.kt"); + } + + @TestMetadata("nonBinaryExpr.kt") + public void testNonBinaryExpr() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/nonBinaryExpr.kt"); + } + + @TestMetadata("notDoubleEquals.kt") + public void testNotDoubleEquals() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/notDoubleEquals.kt"); + } + + @TestMetadata("notEquals.kt") + public void testNotEquals() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/notEquals.kt"); + } + + @TestMetadata("notIn.kt") + public void testNotIn() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/notIn.kt"); + } + + @TestMetadata("notIs.kt") + public void testNotIs() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/notIs.kt"); + } + + @TestMetadata("nullOperand.kt") + public void testNullOperand() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/nullOperand.kt"); + } + + @TestMetadata("plus.kt") + public void testPlus() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/plus.kt"); + } + + @TestMetadata("plusAssign.kt") + public void testPlusAssign() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/plusAssign.kt"); + } + + @TestMetadata("plusInt.kt") + public void testPlusInt() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/plusInt.kt"); + } + + @TestMetadata("plusLiteral.kt") + public void testPlusLiteral() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/plusLiteral.kt"); + } + + @TestMetadata("rangeTo.kt") + public void testRangeTo() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/rangeTo.kt"); + } + + @TestMetadata("rangeToLiteral.kt") + public void testRangeToLiteral() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/rangeToLiteral.kt"); + } + + @TestMetadata("remainder.kt") + public void testRemainder() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/remainder.kt"); + } + + @TestMetadata("remainderAssign.kt") + public void testRemainderAssign() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/remainderAssign.kt"); + } + + @TestMetadata("times.kt") + public void testTimes() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/times.kt"); + } + + @TestMetadata("timesAssign.kt") + public void testTimesAssign() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/timesAssign.kt"); + } + + @TestMetadata("timesLiteral.kt") + public void testTimesLiteral() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/timesLiteral.kt"); + } + + @TestMetadata("xor.kt") + public void testXor() throws Exception { + doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/xor.kt"); + } + + } + public static Test suite() { TestSuite suite = new TestSuite("CodeTransformationTestGenerated"); suite.addTestSuite(ElvisToIfThen.class); @@ -2836,6 +3051,7 @@ public class CodeTransformationTestGenerated extends AbstractCodeTransformationT suite.addTestSuite(SimplifyNegatedBinaryExpressionIntention.class); suite.addTestSuite(ConvertNegatedBooleanSequence.class); suite.addTestSuite(ConvertNegatedExpressionWithDemorgansLaw.class); + suite.addTestSuite(SwapBinaryExpression.class); return suite; } }