From fda7aeecfbe118736d096d1b3b3f8a094103a7e0 Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Mon, 7 Jul 2014 21:09:31 +0400 Subject: [PATCH] Simplified CodeTransformationTest. Only one doTest method remains, intention class is moved to test data. Merged other intention tests (SpecifyTypeExplicitlyTest, ConvertToBlock/ExpressionBodyTest) into this one. --- .../jet/generators/tests/GenerateTests.kt | 72 +- idea/testData/intentions/addBraces/.intention | 1 + .../replaceBinaryInfixIntention/.intention | 1 + .../replaceContainsIntention/.intention | 1 + .../replaceGetIntention/.intention | 1 + .../replaceInvokeIntention/.intention | 1 + .../replaceUnaryPrefixIntention/.intention | 1 + .../branched/doubleBangToIfThen/.intention | 1 + .../branched/elvisToIfThen/.intention | 1 + .../folding/ifToAssignment/.intention | 1 + .../branched/folding/ifToReturn/.intention | 1 + .../ifToReturnAsymmetrically/.intention | 1 + .../folding/whenToAssignment/.intention | 1 + .../branched/folding/whenToReturn/.intention | 1 + .../branched/ifThenToDoubleBang/.intention | 1 + .../branched/ifThenToElvis/.intention | 1 + .../branched/ifThenToSafeAccess/.intention | 1 + .../branched/ifWhen/ifToWhen/.intention | 1 + .../branched/ifWhen/whenToIf/.intention | 1 + .../branched/safeAccessToIfThen/.intention | 1 + .../unfolding/assignmentToIf/.intention | 1 + .../unfolding/assignmentToWhen/.intention | 1 + .../unfolding/propertyToIf/.intention | 1 + .../unfolding/propertyToWhen/.intention | 1 + .../branched/unfolding/returnToIf/.intention | 1 + .../unfolding/returnToWhen/.intention | 1 + .../branched/when/eliminateSubject/.intention | 1 + .../branched/when/flatten/.intention | 1 + .../branched/when/introduceSubject/.intention | 1 + .../intentions/branched/when/merge/.intention | 1 + .../intentions/convertAssertToIf/.intention | 1 + .../intentions/convertIfToAssert/.intention | 1 + .../convertNegatedBooleanSequence/.intention | 1 + .../.intention | 1 + .../intentions/convertToBlockBody/.intention | 1 + .../beforeExplicitlyNonUnitFun.kt | 2 - .../explicitlyNonUnitFun.kt | 1 + ...itFun.kt => explicitlyNonUnitFun.kt.after} | 1 - ...icitlyTypedFunWithUnresolvedExpression.kt} | 1 - ...TypedFunWithUnresolvedExpression.kt.after} | 1 - ...> explicitlyTypedFunWithUnresolvedType.kt} | 1 - ...icitlyTypedFunWithUnresolvedType.kt.after} | 1 - ...licitlyUnitFun.kt => explicitlyUnitFun.kt} | 1 - ...yUnitFun.kt => explicitlyUnitFun.kt.after} | 1 - ...licitlyUnitFunWithUnresolvedExpression.kt} | 1 - ...yUnitFunWithUnresolvedExpression.kt.after} | 1 - ...{beforeFunWithThrow.kt => funWithThrow.kt} | 3 +- ...rFunWithThrow.kt => funWithThrow.kt.after} | 3 +- .../{beforeGetter.kt => getter.kt} | 1 - .../{afterGetter.kt => getter.kt.after} | 1 - ...eGetterWithThrow.kt => getterWithThrow.kt} | 3 +- ...rWithThrow.kt => getterWithThrow.kt.after} | 3 +- ...yNonUnitFun.kt => implicitlyNonUnitFun.kt} | 3 +- ...itFun.kt => implicitlyNonUnitFun.kt.after} | 3 +- ...> implicitlyTypedFunWithUnresolvedType.kt} | 2 +- ...licitlyUnitFun.kt => implicitlyUnitFun.kt} | 1 - ...yUnitFun.kt => implicitlyUnitFun.kt.after} | 1 - .../{beforeNothingFun.kt => nothingFun.kt} | 3 +- ...afterNothingFun.kt => nothingFun.kt.after} | 3 +- .../{beforeSetter.kt => setter.kt} | 1 - .../{afterSetter.kt => setter.kt.after} | 1 - .../.intention | 1 + .../convertToExpressionBody/.intention | 1 + .../afterFunWithReturn.kt | 2 - .../afterFunWithUnitType.kt | 4 - .../afterGetWithReturn.kt | 3 - ...ession.kt => anonymousObjectExpression.kt} | 1 - ....kt => anonymousObjectExpression.kt.after} | 1 - .../convertToExpressionBody/assignment.kt | 8 + .../beforeAssignment.kt | 8 - .../beforeDeclaration.kt | 5 - .../beforeFunWithNoBlock.kt | 3 - .../beforeFunWithUnitType2.kt | 7 - .../beforeMultipleStatements.kt | 6 - .../beforeReturnWithNoValue.kt | 5 - .../convertToExpressionBody/beforeWhile.kt | 5 - .../convertToExpressionBody/declaration.kt | 5 + ...hReturns1.kt => expressionWithReturns1.kt} | 2 +- ...hReturns2.kt => expressionWithReturns2.kt} | 2 +- ...kt => funWithImplicitUnitTypeWithThrow.kt} | 3 +- ...funWithImplicitUnitTypeWithThrow.kt.after} | 3 +- .../convertToExpressionBody/funWithNoBlock.kt | 3 + ...thNothingType.kt => funWithNothingType.kt} | 3 +- ...ingType.kt => funWithNothingType.kt.after} | 3 +- ...eforeFunWithReturn.kt => funWithReturn.kt} | 1 - .../funWithReturn.kt.after | 1 + ...eFunWithUnitType.kt => funWithUnitType.kt} | 1 - .../funWithUnitType.kt.after | 3 + .../funWithUnitType2.kt | 7 + ...thThrow.kt => funWithUnitTypeWithThrow.kt} | 3 +- ...w.kt => funWithUnitTypeWithThrow.kt.after} | 3 +- ...eFunctionLiteral.kt => functionLiteral.kt} | 2 +- ...eforeGetWithReturn.kt => getWithReturn.kt} | 1 - .../getWithReturn.kt.after | 2 + .../multipleStatements.kt | 6 + .../returnWithNoValue.kt | 5 + .../convertToExpressionBody/while.kt | 5 + .../convertToForEachFunctionCall/.intention | 1 + .../convertToForEachLoop/.intention | 1 + .../.intention | 1 + .../convertMemberToExtension/.intention | 1 + .../intentions/declarations/split/.intention | 1 + .../insertCurlyBracesToTemplate/.intention | 1 + .../insertExplicitTypeArguments/.intention | 1 + .../intentions/invertIfCondition/.intention | 1 + .../makeTypeExplicitInLambda/.intention | 1 + .../makeTypeImplicitInLambda/.intention | 1 + .../moveLambdaInsideParentheses/.intention | 1 + .../moveLambdaOutsideParentheses/.intention | 1 + .../intentions/operatorToFunction/.intention | 1 + .../intentions/reconstructedType/.intention | 1 + .../intentions/removeBraces/.intention | 1 + .../removeCurlyBracesFromTemplate/.intention | 1 + .../removeExplicitTypeArguments/.intention | 1 + .../removeUnnecessaryParentheses/.intention | 1 + .../.intention | 1 + .../.intention | 1 + .../.intention | 1 + .../replaceWithInfixFunctionCall/.intention | 1 + .../replaceWithOperatorAssign/.intention | 1 + .../.intention | 1 + .../simplifyBooleanWithConstants/.intention | 1 + .../.intention | 1 + .../intentions/specifyType/.intention | 1 + .../specifyType/afterBadCaretPosition.kt | 3 - .../intentions/specifyType/afterOnType.kt | 3 - .../specifyType/afterPublicMember.kt | 7 - .../specifyType/afterRemoveUnresolvedType.kt | 4 - .../specifyType/afterTypeAlreadyProvided.kt | 2 - .../intentions/specifyType/afterUnitType.kt | 2 - .../specifyType/afterUnknownType.kt | 3 - .../specifyType/badCaretPosition.kt | 3 + .../specifyType/beforeBadCaretPosition.kt | 3 - .../specifyType/beforeFunctionType.kt | 2 - .../intentions/specifyType/beforeOnType.kt | 3 - .../specifyType/beforePublicMember.kt | 7 - .../specifyType/beforeRemoveUnresolvedType.kt | 4 - .../specifyType/beforeStringRedefined.kt | 4 - .../specifyType/beforeTypeAlreadyProvided.kt | 2 - .../intentions/specifyType/beforeUnitType.kt | 2 - .../specifyType/beforeUnknownType.kt | 3 - ...ssNameClashing.kt => classNameClashing.kt} | 4 +- ...Clashing.kt => classNameClashing.kt.after} | 4 +- .../{beforeEnumType.kt => enumType.kt} | 1 - .../{afterEnumType.kt => enumType.kt.after} | 1 - .../intentions/specifyType/functionType.kt | 1 + ...rFunctionType.kt => functionType.kt.after} | 1 - ...eforeLoopParameter.kt => loopParameter.kt} | 3 +- ...oopParameter.kt => loopParameter.kt.after} | 3 +- .../testData/intentions/specifyType/onType.kt | 1 + .../intentions/specifyType/onType.kt.after | 1 + .../intentions/specifyType/publicMember.kt | 9 + .../specifyType/removeUnresolvedType.kt | 6 + .../specifyType/removeUnresolvedType.kt.after | 6 + .../intentions/specifyType/stringRedefined.kt | 3 + ...gRedefined.kt => stringRedefined.kt.after} | 1 - .../specifyType/typeAlreadyProvided.kt | 1 + .../specifyType/typeAlreadyProvided.kt.after | 1 + .../intentions/specifyType/unitType.kt | 1 + .../intentions/specifyType/unitType.kt.after | 1 + .../intentions/specifyType/unknownType.kt | 5 + idea/testData/intentions/splitIf/.intention | 1 + .../swapBinaryExpression/.intention | 1 + .../AbstractCodeTransformationTest.java | 284 +- .../intentions/AbstractIntentionTest.java | 22 - .../CodeTransformationTestGenerated.java | 8693 +++++++++-------- .../ConvertToBlockBodyTestGenerated.java | 104 - .../ConvertToExpressionBodyTestGenerated.java | 124 - .../intentions/SpecifyTypeExplicitlyTest.java | 92 - 169 files changed, 4764 insertions(+), 4969 deletions(-) create mode 100644 idea/testData/intentions/addBraces/.intention create mode 100644 idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/.intention create mode 100644 idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/.intention create mode 100644 idea/testData/intentions/attributeCallReplacements/replaceGetIntention/.intention create mode 100644 idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/.intention create mode 100644 idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/.intention create mode 100644 idea/testData/intentions/branched/doubleBangToIfThen/.intention create mode 100644 idea/testData/intentions/branched/elvisToIfThen/.intention create mode 100644 idea/testData/intentions/branched/folding/ifToAssignment/.intention create mode 100644 idea/testData/intentions/branched/folding/ifToReturn/.intention create mode 100644 idea/testData/intentions/branched/folding/ifToReturnAsymmetrically/.intention create mode 100644 idea/testData/intentions/branched/folding/whenToAssignment/.intention create mode 100644 idea/testData/intentions/branched/folding/whenToReturn/.intention create mode 100644 idea/testData/intentions/branched/ifThenToDoubleBang/.intention create mode 100644 idea/testData/intentions/branched/ifThenToElvis/.intention create mode 100644 idea/testData/intentions/branched/ifThenToSafeAccess/.intention create mode 100644 idea/testData/intentions/branched/ifWhen/ifToWhen/.intention create mode 100644 idea/testData/intentions/branched/ifWhen/whenToIf/.intention create mode 100644 idea/testData/intentions/branched/safeAccessToIfThen/.intention create mode 100644 idea/testData/intentions/branched/unfolding/assignmentToIf/.intention create mode 100644 idea/testData/intentions/branched/unfolding/assignmentToWhen/.intention create mode 100644 idea/testData/intentions/branched/unfolding/propertyToIf/.intention create mode 100644 idea/testData/intentions/branched/unfolding/propertyToWhen/.intention create mode 100644 idea/testData/intentions/branched/unfolding/returnToIf/.intention create mode 100644 idea/testData/intentions/branched/unfolding/returnToWhen/.intention create mode 100644 idea/testData/intentions/branched/when/eliminateSubject/.intention create mode 100644 idea/testData/intentions/branched/when/flatten/.intention create mode 100644 idea/testData/intentions/branched/when/introduceSubject/.intention create mode 100644 idea/testData/intentions/branched/when/merge/.intention create mode 100644 idea/testData/intentions/convertAssertToIf/.intention create mode 100644 idea/testData/intentions/convertIfToAssert/.intention create mode 100644 idea/testData/intentions/convertNegatedBooleanSequence/.intention create mode 100644 idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/.intention create mode 100644 idea/testData/intentions/convertToBlockBody/.intention delete mode 100644 idea/testData/intentions/convertToBlockBody/beforeExplicitlyNonUnitFun.kt create mode 100644 idea/testData/intentions/convertToBlockBody/explicitlyNonUnitFun.kt rename idea/testData/intentions/convertToBlockBody/{afterExplicitlyNonUnitFun.kt => explicitlyNonUnitFun.kt.after} (52%) rename idea/testData/intentions/convertToBlockBody/{beforeExplicitlyTypedFunWithUnresolvedExpression.kt => explicitlyTypedFunWithUnresolvedExpression.kt} (66%) rename idea/testData/intentions/convertToBlockBody/{afterExplicitlyTypedFunWithUnresolvedExpression.kt => explicitlyTypedFunWithUnresolvedExpression.kt.after} (70%) rename idea/testData/intentions/convertToBlockBody/{beforeExplicitlyTypedFunWithUnresolvedType.kt => explicitlyTypedFunWithUnresolvedType.kt} (74%) rename idea/testData/intentions/convertToBlockBody/{afterExplicitlyTypedFunWithUnresolvedType.kt => explicitlyTypedFunWithUnresolvedType.kt.after} (77%) rename idea/testData/intentions/convertToBlockBody/{beforeExplicitlyUnitFun.kt => explicitlyUnitFun.kt} (56%) rename idea/testData/intentions/convertToBlockBody/{afterExplicitlyUnitFun.kt => explicitlyUnitFun.kt.after} (56%) rename idea/testData/intentions/convertToBlockBody/{beforeExplicitlyUnitFunWithUnresolvedExpression.kt => explicitlyUnitFunWithUnresolvedExpression.kt} (66%) rename idea/testData/intentions/convertToBlockBody/{afterExplicitlyUnitFunWithUnresolvedExpression.kt => explicitlyUnitFunWithUnresolvedExpression.kt.after} (67%) rename idea/testData/intentions/convertToBlockBody/{beforeFunWithThrow.kt => funWithThrow.kt} (65%) rename idea/testData/intentions/convertToBlockBody/{afterFunWithThrow.kt => funWithThrow.kt.after} (67%) rename idea/testData/intentions/convertToBlockBody/{beforeGetter.kt => getter.kt} (54%) rename idea/testData/intentions/convertToBlockBody/{afterGetter.kt => getter.kt.after} (62%) rename idea/testData/intentions/convertToBlockBody/{beforeGetterWithThrow.kt => getterWithThrow.kt} (68%) rename idea/testData/intentions/convertToBlockBody/{afterGetterWithThrow.kt => getterWithThrow.kt.after} (70%) rename idea/testData/intentions/convertToBlockBody/{beforeImplicitlyNonUnitFun.kt => implicitlyNonUnitFun.kt} (56%) rename idea/testData/intentions/convertToBlockBody/{afterImplicitlyNonUnitFun.kt => implicitlyNonUnitFun.kt.after} (69%) rename idea/testData/intentions/convertToBlockBody/{beforeImplicitlyTypedFunWithUnresolvedType.kt => implicitlyTypedFunWithUnresolvedType.kt} (63%) rename idea/testData/intentions/convertToBlockBody/{beforeImplicitlyUnitFun.kt => implicitlyUnitFun.kt} (53%) rename idea/testData/intentions/convertToBlockBody/{afterImplicitlyUnitFun.kt => implicitlyUnitFun.kt.after} (52%) rename idea/testData/intentions/convertToBlockBody/{beforeNothingFun.kt => nothingFun.kt} (66%) rename idea/testData/intentions/convertToBlockBody/{afterNothingFun.kt => nothingFun.kt.after} (65%) rename idea/testData/intentions/convertToBlockBody/{beforeSetter.kt => setter.kt} (74%) rename idea/testData/intentions/convertToBlockBody/{afterSetter.kt => setter.kt.after} (75%) create mode 100644 idea/testData/intentions/convertToConcatenatedStringIntention/.intention create mode 100644 idea/testData/intentions/convertToExpressionBody/.intention delete mode 100644 idea/testData/intentions/convertToExpressionBody/afterFunWithReturn.kt delete mode 100644 idea/testData/intentions/convertToExpressionBody/afterFunWithUnitType.kt delete mode 100644 idea/testData/intentions/convertToExpressionBody/afterGetWithReturn.kt rename idea/testData/intentions/convertToExpressionBody/{beforeAnonymousObjectExpression.kt => anonymousObjectExpression.kt} (80%) rename idea/testData/intentions/convertToExpressionBody/{afterAnonymousObjectExpression.kt => anonymousObjectExpression.kt.after} (75%) create mode 100644 idea/testData/intentions/convertToExpressionBody/assignment.kt delete mode 100644 idea/testData/intentions/convertToExpressionBody/beforeAssignment.kt delete mode 100644 idea/testData/intentions/convertToExpressionBody/beforeDeclaration.kt delete mode 100644 idea/testData/intentions/convertToExpressionBody/beforeFunWithNoBlock.kt delete mode 100644 idea/testData/intentions/convertToExpressionBody/beforeFunWithUnitType2.kt delete mode 100644 idea/testData/intentions/convertToExpressionBody/beforeMultipleStatements.kt delete mode 100644 idea/testData/intentions/convertToExpressionBody/beforeReturnWithNoValue.kt delete mode 100644 idea/testData/intentions/convertToExpressionBody/beforeWhile.kt create mode 100644 idea/testData/intentions/convertToExpressionBody/declaration.kt rename idea/testData/intentions/convertToExpressionBody/{beforeExpressionWithReturns1.kt => expressionWithReturns1.kt} (51%) rename idea/testData/intentions/convertToExpressionBody/{beforeExpressionWithReturns2.kt => expressionWithReturns2.kt} (57%) rename idea/testData/intentions/convertToExpressionBody/{beforeFunWithImplicitUnitTypeWithThrow.kt => funWithImplicitUnitTypeWithThrow.kt} (61%) rename idea/testData/intentions/convertToExpressionBody/{afterFunWithUnitTypeWithThrow.kt => funWithImplicitUnitTypeWithThrow.kt.after} (58%) create mode 100644 idea/testData/intentions/convertToExpressionBody/funWithNoBlock.kt rename idea/testData/intentions/convertToExpressionBody/{beforeFunWithNothingType.kt => funWithNothingType.kt} (64%) rename idea/testData/intentions/convertToExpressionBody/{afterFunWithNothingType.kt => funWithNothingType.kt.after} (60%) rename idea/testData/intentions/convertToExpressionBody/{beforeFunWithReturn.kt => funWithReturn.kt} (53%) create mode 100644 idea/testData/intentions/convertToExpressionBody/funWithReturn.kt.after rename idea/testData/intentions/convertToExpressionBody/{beforeFunWithUnitType.kt => funWithUnitType.kt} (53%) create mode 100644 idea/testData/intentions/convertToExpressionBody/funWithUnitType.kt.after create mode 100644 idea/testData/intentions/convertToExpressionBody/funWithUnitType2.kt rename idea/testData/intentions/convertToExpressionBody/{beforeFunWithUnitTypeWithThrow.kt => funWithUnitTypeWithThrow.kt} (63%) rename idea/testData/intentions/convertToExpressionBody/{afterFunWithImplicitUnitTypeWithThrow.kt => funWithUnitTypeWithThrow.kt.after} (58%) rename idea/testData/intentions/convertToExpressionBody/{beforeFunctionLiteral.kt => functionLiteral.kt} (50%) rename idea/testData/intentions/convertToExpressionBody/{beforeGetWithReturn.kt => getWithReturn.kt} (61%) create mode 100644 idea/testData/intentions/convertToExpressionBody/getWithReturn.kt.after create mode 100644 idea/testData/intentions/convertToExpressionBody/multipleStatements.kt create mode 100644 idea/testData/intentions/convertToExpressionBody/returnWithNoValue.kt create mode 100644 idea/testData/intentions/convertToExpressionBody/while.kt create mode 100644 idea/testData/intentions/convertToForEachFunctionCall/.intention create mode 100644 idea/testData/intentions/convertToForEachLoop/.intention create mode 100644 idea/testData/intentions/convertToStringTemplateIntention/.intention create mode 100644 idea/testData/intentions/declarations/convertMemberToExtension/.intention create mode 100644 idea/testData/intentions/declarations/split/.intention create mode 100644 idea/testData/intentions/insertCurlyBracesToTemplate/.intention create mode 100644 idea/testData/intentions/insertExplicitTypeArguments/.intention create mode 100644 idea/testData/intentions/invertIfCondition/.intention create mode 100644 idea/testData/intentions/makeTypeExplicitInLambda/.intention create mode 100644 idea/testData/intentions/makeTypeImplicitInLambda/.intention create mode 100644 idea/testData/intentions/moveLambdaInsideParentheses/.intention create mode 100644 idea/testData/intentions/moveLambdaOutsideParentheses/.intention create mode 100644 idea/testData/intentions/operatorToFunction/.intention create mode 100644 idea/testData/intentions/reconstructedType/.intention create mode 100644 idea/testData/intentions/removeBraces/.intention create mode 100644 idea/testData/intentions/removeCurlyBracesFromTemplate/.intention create mode 100644 idea/testData/intentions/removeExplicitTypeArguments/.intention create mode 100644 idea/testData/intentions/removeUnnecessaryParentheses/.intention create mode 100644 idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt/.intention create mode 100644 idea/testData/intentions/replaceItWithExplicitFunctionLiteralParam/.intention create mode 100644 idea/testData/intentions/replaceWithDotQualifiedMethodCall/.intention create mode 100644 idea/testData/intentions/replaceWithInfixFunctionCall/.intention create mode 100644 idea/testData/intentions/replaceWithOperatorAssign/.intention create mode 100644 idea/testData/intentions/replaceWithTraditionalAssignment/.intention create mode 100644 idea/testData/intentions/simplifyBooleanWithConstants/.intention create mode 100644 idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/.intention create mode 100644 idea/testData/intentions/specifyType/.intention delete mode 100644 idea/testData/intentions/specifyType/afterBadCaretPosition.kt delete mode 100644 idea/testData/intentions/specifyType/afterOnType.kt delete mode 100644 idea/testData/intentions/specifyType/afterPublicMember.kt delete mode 100644 idea/testData/intentions/specifyType/afterRemoveUnresolvedType.kt delete mode 100644 idea/testData/intentions/specifyType/afterTypeAlreadyProvided.kt delete mode 100644 idea/testData/intentions/specifyType/afterUnitType.kt delete mode 100644 idea/testData/intentions/specifyType/afterUnknownType.kt create mode 100644 idea/testData/intentions/specifyType/badCaretPosition.kt delete mode 100644 idea/testData/intentions/specifyType/beforeBadCaretPosition.kt delete mode 100644 idea/testData/intentions/specifyType/beforeFunctionType.kt delete mode 100644 idea/testData/intentions/specifyType/beforeOnType.kt delete mode 100644 idea/testData/intentions/specifyType/beforePublicMember.kt delete mode 100644 idea/testData/intentions/specifyType/beforeRemoveUnresolvedType.kt delete mode 100644 idea/testData/intentions/specifyType/beforeStringRedefined.kt delete mode 100644 idea/testData/intentions/specifyType/beforeTypeAlreadyProvided.kt delete mode 100644 idea/testData/intentions/specifyType/beforeUnitType.kt delete mode 100644 idea/testData/intentions/specifyType/beforeUnknownType.kt rename idea/testData/intentions/specifyType/{beforeClassNameClashing.kt => classNameClashing.kt} (72%) rename idea/testData/intentions/specifyType/{afterClassNameClashing.kt => classNameClashing.kt.after} (79%) rename idea/testData/intentions/specifyType/{beforeEnumType.kt => enumType.kt} (60%) rename idea/testData/intentions/specifyType/{afterEnumType.kt => enumType.kt.after} (60%) create mode 100644 idea/testData/intentions/specifyType/functionType.kt rename idea/testData/intentions/specifyType/{afterFunctionType.kt => functionType.kt.after} (53%) rename idea/testData/intentions/specifyType/{beforeLoopParameter.kt => loopParameter.kt} (76%) rename idea/testData/intentions/specifyType/{afterLoopParameter.kt => loopParameter.kt.after} (80%) create mode 100644 idea/testData/intentions/specifyType/onType.kt create mode 100644 idea/testData/intentions/specifyType/onType.kt.after create mode 100644 idea/testData/intentions/specifyType/publicMember.kt create mode 100644 idea/testData/intentions/specifyType/removeUnresolvedType.kt create mode 100644 idea/testData/intentions/specifyType/removeUnresolvedType.kt.after create mode 100644 idea/testData/intentions/specifyType/stringRedefined.kt rename idea/testData/intentions/specifyType/{afterStringRedefined.kt => stringRedefined.kt.after} (53%) create mode 100644 idea/testData/intentions/specifyType/typeAlreadyProvided.kt create mode 100644 idea/testData/intentions/specifyType/typeAlreadyProvided.kt.after create mode 100644 idea/testData/intentions/specifyType/unitType.kt create mode 100644 idea/testData/intentions/specifyType/unitType.kt.after create mode 100644 idea/testData/intentions/specifyType/unknownType.kt create mode 100644 idea/testData/intentions/splitIf/.intention create mode 100644 idea/testData/intentions/swapBinaryExpression/.intention delete mode 100644 idea/tests/org/jetbrains/jet/plugin/intentions/AbstractIntentionTest.java delete mode 100644 idea/tests/org/jetbrains/jet/plugin/intentions/ConvertToBlockBodyTestGenerated.java delete mode 100644 idea/tests/org/jetbrains/jet/plugin/intentions/ConvertToExpressionBodyTestGenerated.java delete mode 100644 idea/tests/org/jetbrains/jet/plugin/intentions/SpecifyTypeExplicitlyTest.java diff --git a/generators/src/org/jetbrains/jet/generators/tests/GenerateTests.kt b/generators/src/org/jetbrains/jet/generators/tests/GenerateTests.kt index 06b2d3095d2..388ed4c4123 100644 --- a/generators/src/org/jetbrains/jet/generators/tests/GenerateTests.kt +++ b/generators/src/org/jetbrains/jet/generators/tests/GenerateTests.kt @@ -87,7 +87,6 @@ import org.jetbrains.jet.resolve.AbstractReferenceResolveInLibrarySourcesTest import org.jetbrains.jet.resolve.constraintSystem.AbstractConstraintSystemTest import org.jetbrains.jet.completion.AbstractCompiledKotlinInJavaCompletionTest import org.jetbrains.jet.completion.AbstractKotlinSourceInJavaCompletionTest -import org.jetbrains.jet.plugin.intentions.AbstractIntentionTest import org.jetbrains.jet.checkers.AbstractJetDiagnosticsTestWithStdLib import org.jetbrains.jet.plugin.codeInsight.AbstractInsertImportOnPasteTest import org.jetbrains.jet.resolve.AbstractReferenceToJavaWithWrongFileStructureTest @@ -313,14 +312,6 @@ fun main(args: Array) { model("quickfix", pattern = "^before(\\w+)\\.kt$") } - testClass(javaClass(), "ConvertToExpressionBodyTestGenerated") { - model("intentions/convertToExpressionBody", pattern = "^before(\\w+)\\.kt$") - } - - testClass(javaClass(), "ConvertToBlockBodyTestGenerated") { - model("intentions/convertToBlockBody", pattern = "^before(\\w+)\\.kt$") - } - testClass(javaClass()) { model("completion/basic/common") model("completion/basic/js") @@ -391,68 +382,7 @@ fun main(args: Array) { } testClass(javaClass()) { - model("intentions/branched/doubleBangToIfThen", testMethod = "doTestDoubleBangToIfThen") - model("intentions/branched/ifThenToDoubleBang", testMethod = "doTestIfThenToDoubleBang") - model("intentions/branched/elvisToIfThen", testMethod = "doTestElvisToIfThen") - model("intentions/branched/ifThenToElvis", testMethod = "doTestIfThenToElvis") - model("intentions/branched/safeAccessToIfThen", testMethod = "doTestSafeAccessToIfThen") - model("intentions/branched/ifThenToSafeAccess", testMethod = "doTestIfThenToSafeAccess") - model("intentions/branched/folding/ifToAssignment", testMethod = "doTestFoldIfToAssignment") - model("intentions/branched/folding/ifToReturn", testMethod = "doTestFoldIfToReturn") - model("intentions/branched/folding/ifToReturnAsymmetrically", testMethod = "doTestFoldIfToReturnAsymmetrically") - model("intentions/branched/folding/whenToAssignment", testMethod = "doTestFoldWhenToAssignment") - model("intentions/branched/folding/whenToReturn", testMethod = "doTestFoldWhenToReturn") - model("intentions/branched/unfolding/assignmentToIf", testMethod = "doTestUnfoldAssignmentToIf") - model("intentions/branched/unfolding/assignmentToWhen", testMethod = "doTestUnfoldAssignmentToWhen") - model("intentions/branched/unfolding/propertyToIf", testMethod = "doTestUnfoldPropertyToIf") - model("intentions/branched/unfolding/propertyToWhen", testMethod = "doTestUnfoldPropertyToWhen") - model("intentions/branched/unfolding/returnToIf", testMethod = "doTestUnfoldReturnToIf") - model("intentions/branched/unfolding/returnToWhen", testMethod = "doTestUnfoldReturnToWhen") - model("intentions/branched/ifWhen/ifToWhen", testMethod = "doTestIfToWhen") - model("intentions/branched/ifWhen/whenToIf", testMethod = "doTestWhenToIf") - model("intentions/branched/when/flatten", testMethod = "doTestFlattenWhen") - model("intentions/branched/when/merge", testMethod = "doTestMergeWhen") - model("intentions/branched/when/introduceSubject", testMethod = "doTestIntroduceWhenSubject") - model("intentions/branched/when/eliminateSubject", testMethod = "doTestEliminateWhenSubject") - model("intentions/declarations/split", testMethod = "doTestSplitProperty") - model("intentions/declarations/convertMemberToExtension", testMethod = "doTestConvertMemberToExtension") - model("intentions/reconstructedType", testMethod = "doTestReconstructType") - model("intentions/removeUnnecessaryParentheses", testMethod = "doTestRemoveUnnecessaryParentheses") - model("intentions/replaceWithDotQualifiedMethodCall", testMethod = "doTestReplaceWithDotQualifiedMethodCall") - model("intentions/replaceWithInfixFunctionCall", testMethod = "doTestReplaceWithInfixFunctionCall") - model("intentions/removeCurlyBracesFromTemplate", testMethod = "doTestRemoveCurlyFromTemplate") - model("intentions/convertToStringTemplateIntention", testMethod = "doTestConvertToStringTemplate") - model("intentions/convertToConcatenatedStringIntention", testMethod = "doTestConvertToConcatenatedStringIntention") - model("intentions/insertCurlyBracestsToTemplate", testMethod = "doTestInsertCurlyToTemplate") - model("intentions/moveLambdaInsideParentheses", testMethod = "doTestMoveLambdaInsideParentheses") - model("intentions/moveLambdaOutsideParentheses", testMethod = "doTestMoveLambdaOutsideParentheses") - model("intentions/replaceExplicitFunctionLiteralParamWithIt", testMethod = "doTestReplaceExplicitFunctionLiteralParamWithIt") - model("intentions/replaceItWithExplicitFunctionLiteralParam", testMethod = "doTestReplaceItWithExplicitFunctionLiteralParam") - model("intentions/removeBraces", testMethod = "doTestRemoveBraces") - model("intentions/addBraces", testMethod = "doTestAddBraces") - model("intentions/attributeCallReplacements/replaceGetIntention", testMethod = "doTestReplaceGetIntention") - model("intentions/attributeCallReplacements/replaceContainsIntention", testMethod = "doTestReplaceContainsIntention") - model("intentions/attributeCallReplacements/replaceBinaryInfixIntention", testMethod = "doTestReplaceBinaryInfixIntention") - 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") - model("intentions/splitIf", testMethod = "doTestSplitIf") - model("intentions/replaceWithOperatorAssign", testMethod = "doTestReplaceWithOperatorAssign") - model("intentions/replaceWithTraditionalAssignment", testMethod = "doTestReplaceWithTraditionalAssignment") - model("intentions/simplifyBooleanWithConstants", testMethod = "doTestSimplifyBooleanWithConstants") - model("intentions/insertExplicitTypeArguments", testMethod = "doTestInsertExplicitTypeArguments") - model("intentions/removeExplicitTypeArguments", testMethod = "doTestRemoveExplicitTypeArguments") - model("intentions/convertAssertToIf", testMethod = "doTestConvertAssertToIfWithThrowIntention") - model("intentions/convertIfToAssert", testMethod = "doTestConvertIfWithThrowToAssertIntention") - model("intentions/makeTypeExplicitInLambda", testMethod = "doTestMakeTypeExplicitInLambda") - model("intentions/makeTypeImplicitInLambda", testMethod = "doTestMakeTypeImplicitInLambda") - model("intentions/invertIfCondition", testMethod = "doTestInvertIfCondition") - model("intentions/operatorToFunction", testMethod = "doTestOperatorToFunction") - model("intentions/convertToForEachLoop", testMethod = "doTestConvertToForEachLoop") - model("intentions/convertToForEachFunctionCall", testMethod = "doTestConvertToForEachFunctionCall") + model("intentions", testMethod = "doTest") } testClass(javaClass()) { diff --git a/idea/testData/intentions/addBraces/.intention b/idea/testData/intentions/addBraces/.intention new file mode 100644 index 00000000000..f2f1329ee93 --- /dev/null +++ b/idea/testData/intentions/addBraces/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.AddBracesIntention \ No newline at end of file diff --git a/idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/.intention b/idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/.intention new file mode 100644 index 00000000000..c187f500697 --- /dev/null +++ b/idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.TestableReplaceBinaryInfixIntention \ No newline at end of file diff --git a/idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/.intention b/idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/.intention new file mode 100644 index 00000000000..dba96b9ee6c --- /dev/null +++ b/idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.TestableReplaceContainsIntention \ No newline at end of file diff --git a/idea/testData/intentions/attributeCallReplacements/replaceGetIntention/.intention b/idea/testData/intentions/attributeCallReplacements/replaceGetIntention/.intention new file mode 100644 index 00000000000..1cdb22c6264 --- /dev/null +++ b/idea/testData/intentions/attributeCallReplacements/replaceGetIntention/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.TestableReplaceGetIntention \ No newline at end of file diff --git a/idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/.intention b/idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/.intention new file mode 100644 index 00000000000..e772926f66d --- /dev/null +++ b/idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.TestableReplaceInvokeIntention \ No newline at end of file diff --git a/idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/.intention b/idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/.intention new file mode 100644 index 00000000000..ec20e7c5330 --- /dev/null +++ b/idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.TestableReplaceUnaryPrefixIntention \ No newline at end of file diff --git a/idea/testData/intentions/branched/doubleBangToIfThen/.intention b/idea/testData/intentions/branched/doubleBangToIfThen/.intention new file mode 100644 index 00000000000..78086e82ede --- /dev/null +++ b/idea/testData/intentions/branched/doubleBangToIfThen/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.DoubleBangToIfThenIntention \ No newline at end of file diff --git a/idea/testData/intentions/branched/elvisToIfThen/.intention b/idea/testData/intentions/branched/elvisToIfThen/.intention new file mode 100644 index 00000000000..cbfb4eea8fe --- /dev/null +++ b/idea/testData/intentions/branched/elvisToIfThen/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.ElvisToIfThenIntention \ No newline at end of file diff --git a/idea/testData/intentions/branched/folding/ifToAssignment/.intention b/idea/testData/intentions/branched/folding/ifToAssignment/.intention new file mode 100644 index 00000000000..e645192a549 --- /dev/null +++ b/idea/testData/intentions/branched/folding/ifToAssignment/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.FoldIfToAssignmentIntention \ No newline at end of file diff --git a/idea/testData/intentions/branched/folding/ifToReturn/.intention b/idea/testData/intentions/branched/folding/ifToReturn/.intention new file mode 100644 index 00000000000..1e17480ad01 --- /dev/null +++ b/idea/testData/intentions/branched/folding/ifToReturn/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.FoldIfToReturnIntention \ No newline at end of file diff --git a/idea/testData/intentions/branched/folding/ifToReturnAsymmetrically/.intention b/idea/testData/intentions/branched/folding/ifToReturnAsymmetrically/.intention new file mode 100644 index 00000000000..9155c954aa2 --- /dev/null +++ b/idea/testData/intentions/branched/folding/ifToReturnAsymmetrically/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.FoldIfToReturnAsymmetricallyIntention \ No newline at end of file diff --git a/idea/testData/intentions/branched/folding/whenToAssignment/.intention b/idea/testData/intentions/branched/folding/whenToAssignment/.intention new file mode 100644 index 00000000000..6167bb53372 --- /dev/null +++ b/idea/testData/intentions/branched/folding/whenToAssignment/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.FoldWhenToAssignmentIntention \ No newline at end of file diff --git a/idea/testData/intentions/branched/folding/whenToReturn/.intention b/idea/testData/intentions/branched/folding/whenToReturn/.intention new file mode 100644 index 00000000000..4f7eb22092b --- /dev/null +++ b/idea/testData/intentions/branched/folding/whenToReturn/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.FoldWhenToReturnIntention \ No newline at end of file diff --git a/idea/testData/intentions/branched/ifThenToDoubleBang/.intention b/idea/testData/intentions/branched/ifThenToDoubleBang/.intention new file mode 100644 index 00000000000..8b8739474e3 --- /dev/null +++ b/idea/testData/intentions/branched/ifThenToDoubleBang/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.IfThenToDoubleBangIntention \ No newline at end of file diff --git a/idea/testData/intentions/branched/ifThenToElvis/.intention b/idea/testData/intentions/branched/ifThenToElvis/.intention new file mode 100644 index 00000000000..57eab5b4c17 --- /dev/null +++ b/idea/testData/intentions/branched/ifThenToElvis/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.IfThenToElvisIntention \ No newline at end of file diff --git a/idea/testData/intentions/branched/ifThenToSafeAccess/.intention b/idea/testData/intentions/branched/ifThenToSafeAccess/.intention new file mode 100644 index 00000000000..d8a8925188a --- /dev/null +++ b/idea/testData/intentions/branched/ifThenToSafeAccess/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.IfThenToSafeAccessIntention \ No newline at end of file diff --git a/idea/testData/intentions/branched/ifWhen/ifToWhen/.intention b/idea/testData/intentions/branched/ifWhen/ifToWhen/.intention new file mode 100644 index 00000000000..5d8f2edf1fc --- /dev/null +++ b/idea/testData/intentions/branched/ifWhen/ifToWhen/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.IfToWhenIntention \ No newline at end of file diff --git a/idea/testData/intentions/branched/ifWhen/whenToIf/.intention b/idea/testData/intentions/branched/ifWhen/whenToIf/.intention new file mode 100644 index 00000000000..5493d73b460 --- /dev/null +++ b/idea/testData/intentions/branched/ifWhen/whenToIf/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.WhenToIfIntention \ No newline at end of file diff --git a/idea/testData/intentions/branched/safeAccessToIfThen/.intention b/idea/testData/intentions/branched/safeAccessToIfThen/.intention new file mode 100644 index 00000000000..6ddec789854 --- /dev/null +++ b/idea/testData/intentions/branched/safeAccessToIfThen/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.SafeAccessToIfThenIntention \ No newline at end of file diff --git a/idea/testData/intentions/branched/unfolding/assignmentToIf/.intention b/idea/testData/intentions/branched/unfolding/assignmentToIf/.intention new file mode 100644 index 00000000000..e4153abfdf3 --- /dev/null +++ b/idea/testData/intentions/branched/unfolding/assignmentToIf/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.UnfoldAssignmentToIfIntention \ No newline at end of file diff --git a/idea/testData/intentions/branched/unfolding/assignmentToWhen/.intention b/idea/testData/intentions/branched/unfolding/assignmentToWhen/.intention new file mode 100644 index 00000000000..b0c8a1def96 --- /dev/null +++ b/idea/testData/intentions/branched/unfolding/assignmentToWhen/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.UnfoldAssignmentToWhenIntention \ No newline at end of file diff --git a/idea/testData/intentions/branched/unfolding/propertyToIf/.intention b/idea/testData/intentions/branched/unfolding/propertyToIf/.intention new file mode 100644 index 00000000000..8b0fd3bbac9 --- /dev/null +++ b/idea/testData/intentions/branched/unfolding/propertyToIf/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.UnfoldPropertyToIfIntention \ No newline at end of file diff --git a/idea/testData/intentions/branched/unfolding/propertyToWhen/.intention b/idea/testData/intentions/branched/unfolding/propertyToWhen/.intention new file mode 100644 index 00000000000..b74c82759ba --- /dev/null +++ b/idea/testData/intentions/branched/unfolding/propertyToWhen/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.UnfoldPropertyToWhenIntention \ No newline at end of file diff --git a/idea/testData/intentions/branched/unfolding/returnToIf/.intention b/idea/testData/intentions/branched/unfolding/returnToIf/.intention new file mode 100644 index 00000000000..e19b7b78d88 --- /dev/null +++ b/idea/testData/intentions/branched/unfolding/returnToIf/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.UnfoldReturnToIfIntention \ No newline at end of file diff --git a/idea/testData/intentions/branched/unfolding/returnToWhen/.intention b/idea/testData/intentions/branched/unfolding/returnToWhen/.intention new file mode 100644 index 00000000000..e9b7c33aa81 --- /dev/null +++ b/idea/testData/intentions/branched/unfolding/returnToWhen/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.UnfoldReturnToWhenIntention \ No newline at end of file diff --git a/idea/testData/intentions/branched/when/eliminateSubject/.intention b/idea/testData/intentions/branched/when/eliminateSubject/.intention new file mode 100644 index 00000000000..7921603fdbb --- /dev/null +++ b/idea/testData/intentions/branched/when/eliminateSubject/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.EliminateWhenSubjectIntention \ No newline at end of file diff --git a/idea/testData/intentions/branched/when/flatten/.intention b/idea/testData/intentions/branched/when/flatten/.intention new file mode 100644 index 00000000000..8de846a080b --- /dev/null +++ b/idea/testData/intentions/branched/when/flatten/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.FlattenWhenIntention \ No newline at end of file diff --git a/idea/testData/intentions/branched/when/introduceSubject/.intention b/idea/testData/intentions/branched/when/introduceSubject/.intention new file mode 100644 index 00000000000..da8bb6a594a --- /dev/null +++ b/idea/testData/intentions/branched/when/introduceSubject/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.IntroduceWhenSubjectIntention \ No newline at end of file diff --git a/idea/testData/intentions/branched/when/merge/.intention b/idea/testData/intentions/branched/when/merge/.intention new file mode 100644 index 00000000000..efa026133ba --- /dev/null +++ b/idea/testData/intentions/branched/when/merge/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.MergeWhenIntention \ No newline at end of file diff --git a/idea/testData/intentions/convertAssertToIf/.intention b/idea/testData/intentions/convertAssertToIf/.intention new file mode 100644 index 00000000000..b253d692c2f --- /dev/null +++ b/idea/testData/intentions/convertAssertToIf/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.ConvertAssertToIfWithThrowIntention \ No newline at end of file diff --git a/idea/testData/intentions/convertIfToAssert/.intention b/idea/testData/intentions/convertIfToAssert/.intention new file mode 100644 index 00000000000..9fe28fdaa90 --- /dev/null +++ b/idea/testData/intentions/convertIfToAssert/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.ConvertIfWithThrowToAssertIntention \ No newline at end of file diff --git a/idea/testData/intentions/convertNegatedBooleanSequence/.intention b/idea/testData/intentions/convertNegatedBooleanSequence/.intention new file mode 100644 index 00000000000..98d3c7d831c --- /dev/null +++ b/idea/testData/intentions/convertNegatedBooleanSequence/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.ConvertNegatedBooleanSequenceIntention \ No newline at end of file diff --git a/idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/.intention b/idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/.intention new file mode 100644 index 00000000000..e8c746d94f2 --- /dev/null +++ b/idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.ConvertNegatedExpressionWithDemorgansLawIntention \ No newline at end of file diff --git a/idea/testData/intentions/convertToBlockBody/.intention b/idea/testData/intentions/convertToBlockBody/.intention new file mode 100644 index 00000000000..6cb3ad60700 --- /dev/null +++ b/idea/testData/intentions/convertToBlockBody/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.ConvertToBlockBodyAction \ No newline at end of file diff --git a/idea/testData/intentions/convertToBlockBody/beforeExplicitlyNonUnitFun.kt b/idea/testData/intentions/convertToBlockBody/beforeExplicitlyNonUnitFun.kt deleted file mode 100644 index 62c70de650f..00000000000 --- a/idea/testData/intentions/convertToBlockBody/beforeExplicitlyNonUnitFun.kt +++ /dev/null @@ -1,2 +0,0 @@ -// "Convert to block body" "true" -fun foo(): String = "abc" \ No newline at end of file diff --git a/idea/testData/intentions/convertToBlockBody/explicitlyNonUnitFun.kt b/idea/testData/intentions/convertToBlockBody/explicitlyNonUnitFun.kt new file mode 100644 index 00000000000..a05e7397914 --- /dev/null +++ b/idea/testData/intentions/convertToBlockBody/explicitlyNonUnitFun.kt @@ -0,0 +1 @@ +fun foo(): String = "abc" \ No newline at end of file diff --git a/idea/testData/intentions/convertToBlockBody/afterExplicitlyNonUnitFun.kt b/idea/testData/intentions/convertToBlockBody/explicitlyNonUnitFun.kt.after similarity index 52% rename from idea/testData/intentions/convertToBlockBody/afterExplicitlyNonUnitFun.kt rename to idea/testData/intentions/convertToBlockBody/explicitlyNonUnitFun.kt.after index e5ccc8d2fcb..944fcfe9a49 100644 --- a/idea/testData/intentions/convertToBlockBody/afterExplicitlyNonUnitFun.kt +++ b/idea/testData/intentions/convertToBlockBody/explicitlyNonUnitFun.kt.after @@ -1,4 +1,3 @@ -// "Convert to block body" "true" fun foo(): String { return "abc" } \ No newline at end of file diff --git a/idea/testData/intentions/convertToBlockBody/beforeExplicitlyTypedFunWithUnresolvedExpression.kt b/idea/testData/intentions/convertToBlockBody/explicitlyTypedFunWithUnresolvedExpression.kt similarity index 66% rename from idea/testData/intentions/convertToBlockBody/beforeExplicitlyTypedFunWithUnresolvedExpression.kt rename to idea/testData/intentions/convertToBlockBody/explicitlyTypedFunWithUnresolvedExpression.kt index f0cd89549fa..a767f28b8ac 100644 --- a/idea/testData/intentions/convertToBlockBody/beforeExplicitlyTypedFunWithUnresolvedExpression.kt +++ b/idea/testData/intentions/convertToBlockBody/explicitlyTypedFunWithUnresolvedExpression.kt @@ -1,3 +1,2 @@ -// "Convert to block body" "true" // ERROR: Unresolved reference: bar fun foo(): String = bar() \ No newline at end of file diff --git a/idea/testData/intentions/convertToBlockBody/afterExplicitlyTypedFunWithUnresolvedExpression.kt b/idea/testData/intentions/convertToBlockBody/explicitlyTypedFunWithUnresolvedExpression.kt.after similarity index 70% rename from idea/testData/intentions/convertToBlockBody/afterExplicitlyTypedFunWithUnresolvedExpression.kt rename to idea/testData/intentions/convertToBlockBody/explicitlyTypedFunWithUnresolvedExpression.kt.after index e9e5dc494f0..9af28205239 100644 --- a/idea/testData/intentions/convertToBlockBody/afterExplicitlyTypedFunWithUnresolvedExpression.kt +++ b/idea/testData/intentions/convertToBlockBody/explicitlyTypedFunWithUnresolvedExpression.kt.after @@ -1,4 +1,3 @@ -// "Convert to block body" "true" // ERROR: Unresolved reference: bar fun foo(): String { return bar() diff --git a/idea/testData/intentions/convertToBlockBody/beforeExplicitlyTypedFunWithUnresolvedType.kt b/idea/testData/intentions/convertToBlockBody/explicitlyTypedFunWithUnresolvedType.kt similarity index 74% rename from idea/testData/intentions/convertToBlockBody/beforeExplicitlyTypedFunWithUnresolvedType.kt rename to idea/testData/intentions/convertToBlockBody/explicitlyTypedFunWithUnresolvedType.kt index 6adedad467e..98948bb805c 100644 --- a/idea/testData/intentions/convertToBlockBody/beforeExplicitlyTypedFunWithUnresolvedType.kt +++ b/idea/testData/intentions/convertToBlockBody/explicitlyTypedFunWithUnresolvedType.kt @@ -1,4 +1,3 @@ -// "Convert to block body" "true" // ERROR: Unresolved reference: XXX // ERROR: Unresolved reference: bar fun foo(): XXX = bar() \ No newline at end of file diff --git a/idea/testData/intentions/convertToBlockBody/afterExplicitlyTypedFunWithUnresolvedType.kt b/idea/testData/intentions/convertToBlockBody/explicitlyTypedFunWithUnresolvedType.kt.after similarity index 77% rename from idea/testData/intentions/convertToBlockBody/afterExplicitlyTypedFunWithUnresolvedType.kt rename to idea/testData/intentions/convertToBlockBody/explicitlyTypedFunWithUnresolvedType.kt.after index 4250fa599da..6a0df52fd48 100644 --- a/idea/testData/intentions/convertToBlockBody/afterExplicitlyTypedFunWithUnresolvedType.kt +++ b/idea/testData/intentions/convertToBlockBody/explicitlyTypedFunWithUnresolvedType.kt.after @@ -1,4 +1,3 @@ -// "Convert to block body" "true" // ERROR: Unresolved reference: XXX // ERROR: Unresolved reference: bar fun foo(): XXX { diff --git a/idea/testData/intentions/convertToBlockBody/beforeExplicitlyUnitFun.kt b/idea/testData/intentions/convertToBlockBody/explicitlyUnitFun.kt similarity index 56% rename from idea/testData/intentions/convertToBlockBody/beforeExplicitlyUnitFun.kt rename to idea/testData/intentions/convertToBlockBody/explicitlyUnitFun.kt index 1a4fd1c965e..29201d9b2bc 100644 --- a/idea/testData/intentions/convertToBlockBody/beforeExplicitlyUnitFun.kt +++ b/idea/testData/intentions/convertToBlockBody/explicitlyUnitFun.kt @@ -1,4 +1,3 @@ -// "Convert to block body" "true" fun foo(): Unit = bar() fun bar() { } \ No newline at end of file diff --git a/idea/testData/intentions/convertToBlockBody/afterExplicitlyUnitFun.kt b/idea/testData/intentions/convertToBlockBody/explicitlyUnitFun.kt.after similarity index 56% rename from idea/testData/intentions/convertToBlockBody/afterExplicitlyUnitFun.kt rename to idea/testData/intentions/convertToBlockBody/explicitlyUnitFun.kt.after index 863820e77f9..eac656635a1 100644 --- a/idea/testData/intentions/convertToBlockBody/afterExplicitlyUnitFun.kt +++ b/idea/testData/intentions/convertToBlockBody/explicitlyUnitFun.kt.after @@ -1,4 +1,3 @@ -// "Convert to block body" "true" fun foo(): Unit { bar() } diff --git a/idea/testData/intentions/convertToBlockBody/beforeExplicitlyUnitFunWithUnresolvedExpression.kt b/idea/testData/intentions/convertToBlockBody/explicitlyUnitFunWithUnresolvedExpression.kt similarity index 66% rename from idea/testData/intentions/convertToBlockBody/beforeExplicitlyUnitFunWithUnresolvedExpression.kt rename to idea/testData/intentions/convertToBlockBody/explicitlyUnitFunWithUnresolvedExpression.kt index 9b04cc50eb6..18a11f2d0c4 100644 --- a/idea/testData/intentions/convertToBlockBody/beforeExplicitlyUnitFunWithUnresolvedExpression.kt +++ b/idea/testData/intentions/convertToBlockBody/explicitlyUnitFunWithUnresolvedExpression.kt @@ -1,3 +1,2 @@ -// "Convert to block body" "true" // ERROR: Unresolved reference: bar fun foo(): Unit = bar() \ No newline at end of file diff --git a/idea/testData/intentions/convertToBlockBody/afterExplicitlyUnitFunWithUnresolvedExpression.kt b/idea/testData/intentions/convertToBlockBody/explicitlyUnitFunWithUnresolvedExpression.kt.after similarity index 67% rename from idea/testData/intentions/convertToBlockBody/afterExplicitlyUnitFunWithUnresolvedExpression.kt rename to idea/testData/intentions/convertToBlockBody/explicitlyUnitFunWithUnresolvedExpression.kt.after index 89be834b5ce..0468c9f6c31 100644 --- a/idea/testData/intentions/convertToBlockBody/afterExplicitlyUnitFunWithUnresolvedExpression.kt +++ b/idea/testData/intentions/convertToBlockBody/explicitlyUnitFunWithUnresolvedExpression.kt.after @@ -1,4 +1,3 @@ -// "Convert to block body" "true" // ERROR: Unresolved reference: bar fun foo(): Unit { bar() diff --git a/idea/testData/intentions/convertToBlockBody/beforeFunWithThrow.kt b/idea/testData/intentions/convertToBlockBody/funWithThrow.kt similarity index 65% rename from idea/testData/intentions/convertToBlockBody/beforeFunWithThrow.kt rename to idea/testData/intentions/convertToBlockBody/funWithThrow.kt index 690a5b74894..b21b2c8a2e1 100644 --- a/idea/testData/intentions/convertToBlockBody/beforeFunWithThrow.kt +++ b/idea/testData/intentions/convertToBlockBody/funWithThrow.kt @@ -1,2 +1,3 @@ -// "Convert to block body" "true" +// WITH_RUNTIME + fun foo(): String = throw UnsupportedOperationException() diff --git a/idea/testData/intentions/convertToBlockBody/afterFunWithThrow.kt b/idea/testData/intentions/convertToBlockBody/funWithThrow.kt.after similarity index 67% rename from idea/testData/intentions/convertToBlockBody/afterFunWithThrow.kt rename to idea/testData/intentions/convertToBlockBody/funWithThrow.kt.after index 2575862c23d..d9b540db6a0 100644 --- a/idea/testData/intentions/convertToBlockBody/afterFunWithThrow.kt +++ b/idea/testData/intentions/convertToBlockBody/funWithThrow.kt.after @@ -1,4 +1,5 @@ -// "Convert to block body" "true" +// WITH_RUNTIME + fun foo(): String { throw UnsupportedOperationException() } diff --git a/idea/testData/intentions/convertToBlockBody/beforeGetter.kt b/idea/testData/intentions/convertToBlockBody/getter.kt similarity index 54% rename from idea/testData/intentions/convertToBlockBody/beforeGetter.kt rename to idea/testData/intentions/convertToBlockBody/getter.kt index 4a43535a1cf..e0cbc707b4f 100644 --- a/idea/testData/intentions/convertToBlockBody/beforeGetter.kt +++ b/idea/testData/intentions/convertToBlockBody/getter.kt @@ -1,3 +1,2 @@ -// "Convert to block body" "true" val foo: String get() = "abc" diff --git a/idea/testData/intentions/convertToBlockBody/afterGetter.kt b/idea/testData/intentions/convertToBlockBody/getter.kt.after similarity index 62% rename from idea/testData/intentions/convertToBlockBody/afterGetter.kt rename to idea/testData/intentions/convertToBlockBody/getter.kt.after index 7283bddc24f..940c7565002 100644 --- a/idea/testData/intentions/convertToBlockBody/afterGetter.kt +++ b/idea/testData/intentions/convertToBlockBody/getter.kt.after @@ -1,4 +1,3 @@ -// "Convert to block body" "true" val foo: String get() { return "abc" diff --git a/idea/testData/intentions/convertToBlockBody/beforeGetterWithThrow.kt b/idea/testData/intentions/convertToBlockBody/getterWithThrow.kt similarity index 68% rename from idea/testData/intentions/convertToBlockBody/beforeGetterWithThrow.kt rename to idea/testData/intentions/convertToBlockBody/getterWithThrow.kt index 89f3627c261..6bc1d252d07 100644 --- a/idea/testData/intentions/convertToBlockBody/beforeGetterWithThrow.kt +++ b/idea/testData/intentions/convertToBlockBody/getterWithThrow.kt @@ -1,3 +1,4 @@ -// "Convert to block body" "true" +// WITH_RUNTIME + val foo: String get() = throw UnsupportedOperationException() diff --git a/idea/testData/intentions/convertToBlockBody/afterGetterWithThrow.kt b/idea/testData/intentions/convertToBlockBody/getterWithThrow.kt.after similarity index 70% rename from idea/testData/intentions/convertToBlockBody/afterGetterWithThrow.kt rename to idea/testData/intentions/convertToBlockBody/getterWithThrow.kt.after index 38c6f520198..4f97f4d3f4c 100644 --- a/idea/testData/intentions/convertToBlockBody/afterGetterWithThrow.kt +++ b/idea/testData/intentions/convertToBlockBody/getterWithThrow.kt.after @@ -1,4 +1,5 @@ -// "Convert to block body" "true" +// WITH_RUNTIME + val foo: String get() { throw UnsupportedOperationException() diff --git a/idea/testData/intentions/convertToBlockBody/beforeImplicitlyNonUnitFun.kt b/idea/testData/intentions/convertToBlockBody/implicitlyNonUnitFun.kt similarity index 56% rename from idea/testData/intentions/convertToBlockBody/beforeImplicitlyNonUnitFun.kt rename to idea/testData/intentions/convertToBlockBody/implicitlyNonUnitFun.kt index a2fda239325..2c4d1012850 100644 --- a/idea/testData/intentions/convertToBlockBody/beforeImplicitlyNonUnitFun.kt +++ b/idea/testData/intentions/convertToBlockBody/implicitlyNonUnitFun.kt @@ -1,2 +1,3 @@ -// "Convert to block body" "true" +// WITH_RUNTIME + fun foo() = java.io.File("x").toURI() \ No newline at end of file diff --git a/idea/testData/intentions/convertToBlockBody/afterImplicitlyNonUnitFun.kt b/idea/testData/intentions/convertToBlockBody/implicitlyNonUnitFun.kt.after similarity index 69% rename from idea/testData/intentions/convertToBlockBody/afterImplicitlyNonUnitFun.kt rename to idea/testData/intentions/convertToBlockBody/implicitlyNonUnitFun.kt.after index 67fee5fc663..5c4f4cf5446 100644 --- a/idea/testData/intentions/convertToBlockBody/afterImplicitlyNonUnitFun.kt +++ b/idea/testData/intentions/convertToBlockBody/implicitlyNonUnitFun.kt.after @@ -1,4 +1,5 @@ -// "Convert to block body" "true" +// WITH_RUNTIME + import java.net.URI fun foo(): URI { diff --git a/idea/testData/intentions/convertToBlockBody/beforeImplicitlyTypedFunWithUnresolvedType.kt b/idea/testData/intentions/convertToBlockBody/implicitlyTypedFunWithUnresolvedType.kt similarity index 63% rename from idea/testData/intentions/convertToBlockBody/beforeImplicitlyTypedFunWithUnresolvedType.kt rename to idea/testData/intentions/convertToBlockBody/implicitlyTypedFunWithUnresolvedType.kt index 9d67eb2d2a6..6cb6b05bf03 100644 --- a/idea/testData/intentions/convertToBlockBody/beforeImplicitlyTypedFunWithUnresolvedType.kt +++ b/idea/testData/intentions/convertToBlockBody/implicitlyTypedFunWithUnresolvedType.kt @@ -1,3 +1,3 @@ -// "Convert to block body" "false" +// IS_APPLICABLE: false // ERROR: Unresolved reference: bar fun foo() = bar() \ No newline at end of file diff --git a/idea/testData/intentions/convertToBlockBody/beforeImplicitlyUnitFun.kt b/idea/testData/intentions/convertToBlockBody/implicitlyUnitFun.kt similarity index 53% rename from idea/testData/intentions/convertToBlockBody/beforeImplicitlyUnitFun.kt rename to idea/testData/intentions/convertToBlockBody/implicitlyUnitFun.kt index 9a219f8eb80..08773ae0675 100644 --- a/idea/testData/intentions/convertToBlockBody/beforeImplicitlyUnitFun.kt +++ b/idea/testData/intentions/convertToBlockBody/implicitlyUnitFun.kt @@ -1,4 +1,3 @@ -// "Convert to block body" "true" fun foo() = bar() fun bar() { } \ No newline at end of file diff --git a/idea/testData/intentions/convertToBlockBody/afterImplicitlyUnitFun.kt b/idea/testData/intentions/convertToBlockBody/implicitlyUnitFun.kt.after similarity index 52% rename from idea/testData/intentions/convertToBlockBody/afterImplicitlyUnitFun.kt rename to idea/testData/intentions/convertToBlockBody/implicitlyUnitFun.kt.after index ca221f8f45d..2128117a199 100644 --- a/idea/testData/intentions/convertToBlockBody/afterImplicitlyUnitFun.kt +++ b/idea/testData/intentions/convertToBlockBody/implicitlyUnitFun.kt.after @@ -1,4 +1,3 @@ -// "Convert to block body" "true" fun foo() { bar() } diff --git a/idea/testData/intentions/convertToBlockBody/beforeNothingFun.kt b/idea/testData/intentions/convertToBlockBody/nothingFun.kt similarity index 66% rename from idea/testData/intentions/convertToBlockBody/beforeNothingFun.kt rename to idea/testData/intentions/convertToBlockBody/nothingFun.kt index a0bf8315cbd..e4045f05f4d 100644 --- a/idea/testData/intentions/convertToBlockBody/beforeNothingFun.kt +++ b/idea/testData/intentions/convertToBlockBody/nothingFun.kt @@ -1,2 +1,3 @@ -// "Convert to block body" "true" +// WITH_RUNTIME + fun foo(): Nothing = throw UnsupportedOperationException() diff --git a/idea/testData/intentions/convertToBlockBody/afterNothingFun.kt b/idea/testData/intentions/convertToBlockBody/nothingFun.kt.after similarity index 65% rename from idea/testData/intentions/convertToBlockBody/afterNothingFun.kt rename to idea/testData/intentions/convertToBlockBody/nothingFun.kt.after index 5b860e242b8..9f6cee0b651 100644 --- a/idea/testData/intentions/convertToBlockBody/afterNothingFun.kt +++ b/idea/testData/intentions/convertToBlockBody/nothingFun.kt.after @@ -1,4 +1,5 @@ -// "Convert to block body" "true" +// WITH_RUNTIME + fun foo(): Nothing { throw UnsupportedOperationException() } diff --git a/idea/testData/intentions/convertToBlockBody/beforeSetter.kt b/idea/testData/intentions/convertToBlockBody/setter.kt similarity index 74% rename from idea/testData/intentions/convertToBlockBody/beforeSetter.kt rename to idea/testData/intentions/convertToBlockBody/setter.kt index 11a54d01b05..f81d45ce61d 100644 --- a/idea/testData/intentions/convertToBlockBody/beforeSetter.kt +++ b/idea/testData/intentions/convertToBlockBody/setter.kt @@ -1,4 +1,3 @@ -// "Convert to block body" "true" var foo: String get() = "abc" set(value) = doSet(value) diff --git a/idea/testData/intentions/convertToBlockBody/afterSetter.kt b/idea/testData/intentions/convertToBlockBody/setter.kt.after similarity index 75% rename from idea/testData/intentions/convertToBlockBody/afterSetter.kt rename to idea/testData/intentions/convertToBlockBody/setter.kt.after index 1dd47224ffd..5e343c1de61 100644 --- a/idea/testData/intentions/convertToBlockBody/afterSetter.kt +++ b/idea/testData/intentions/convertToBlockBody/setter.kt.after @@ -1,4 +1,3 @@ -// "Convert to block body" "true" var foo: String get() = "abc" set(value) { diff --git a/idea/testData/intentions/convertToConcatenatedStringIntention/.intention b/idea/testData/intentions/convertToConcatenatedStringIntention/.intention new file mode 100644 index 00000000000..7ce41a964f5 --- /dev/null +++ b/idea/testData/intentions/convertToConcatenatedStringIntention/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.ConvertToConcatenatedStringIntention \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/.intention b/idea/testData/intentions/convertToExpressionBody/.intention new file mode 100644 index 00000000000..80a55e5f100 --- /dev/null +++ b/idea/testData/intentions/convertToExpressionBody/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.ConvertToExpressionBodyAction \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/afterFunWithReturn.kt b/idea/testData/intentions/convertToExpressionBody/afterFunWithReturn.kt deleted file mode 100644 index 0c237529970..00000000000 --- a/idea/testData/intentions/convertToExpressionBody/afterFunWithReturn.kt +++ /dev/null @@ -1,2 +0,0 @@ -// "Convert to expression body" "true" -fun foo(): String = "abc" \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/afterFunWithUnitType.kt b/idea/testData/intentions/convertToExpressionBody/afterFunWithUnitType.kt deleted file mode 100644 index 451eacac56d..00000000000 --- a/idea/testData/intentions/convertToExpressionBody/afterFunWithUnitType.kt +++ /dev/null @@ -1,4 +0,0 @@ -// "Convert to expression body" "true" -fun foo() = bar() - -fun bar() { } \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/afterGetWithReturn.kt b/idea/testData/intentions/convertToExpressionBody/afterGetWithReturn.kt deleted file mode 100644 index 8606345e795..00000000000 --- a/idea/testData/intentions/convertToExpressionBody/afterGetWithReturn.kt +++ /dev/null @@ -1,3 +0,0 @@ -// "Convert to expression body" "true" -val foo: String - get() = "abc" \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/beforeAnonymousObjectExpression.kt b/idea/testData/intentions/convertToExpressionBody/anonymousObjectExpression.kt similarity index 80% rename from idea/testData/intentions/convertToExpressionBody/beforeAnonymousObjectExpression.kt rename to idea/testData/intentions/convertToExpressionBody/anonymousObjectExpression.kt index e93c095665f..063a2c8ad86 100644 --- a/idea/testData/intentions/convertToExpressionBody/beforeAnonymousObjectExpression.kt +++ b/idea/testData/intentions/convertToExpressionBody/anonymousObjectExpression.kt @@ -1,4 +1,3 @@ -// "Convert to expression body" "true" trait I { fun foo(): String } diff --git a/idea/testData/intentions/convertToExpressionBody/afterAnonymousObjectExpression.kt b/idea/testData/intentions/convertToExpressionBody/anonymousObjectExpression.kt.after similarity index 75% rename from idea/testData/intentions/convertToExpressionBody/afterAnonymousObjectExpression.kt rename to idea/testData/intentions/convertToExpressionBody/anonymousObjectExpression.kt.after index 61f5253b84c..7b8029c1e54 100644 --- a/idea/testData/intentions/convertToExpressionBody/afterAnonymousObjectExpression.kt +++ b/idea/testData/intentions/convertToExpressionBody/anonymousObjectExpression.kt.after @@ -1,4 +1,3 @@ -// "Convert to expression body" "true" trait I { fun foo(): String } diff --git a/idea/testData/intentions/convertToExpressionBody/assignment.kt b/idea/testData/intentions/convertToExpressionBody/assignment.kt new file mode 100644 index 00000000000..a39404cac4d --- /dev/null +++ b/idea/testData/intentions/convertToExpressionBody/assignment.kt @@ -0,0 +1,8 @@ +// IS_APPLICABLE: false + +var a = 1 +var b = 2 + +fun foo() { + a = b +} \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/beforeAssignment.kt b/idea/testData/intentions/convertToExpressionBody/beforeAssignment.kt deleted file mode 100644 index 60191c9e7ea..00000000000 --- a/idea/testData/intentions/convertToExpressionBody/beforeAssignment.kt +++ /dev/null @@ -1,8 +0,0 @@ -// "class org.jetbrains.jet.plugin.intentions.ConvertToExpressionBodyAction" "false" - -var a = 1 -var b = 2 - -fun foo() { - a = b -} \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/beforeDeclaration.kt b/idea/testData/intentions/convertToExpressionBody/beforeDeclaration.kt deleted file mode 100644 index 017b0d53f58..00000000000 --- a/idea/testData/intentions/convertToExpressionBody/beforeDeclaration.kt +++ /dev/null @@ -1,5 +0,0 @@ -// "class org.jetbrains.jet.plugin.intentions.ConvertToExpressionBodyAction" "false" - -fun foo() { - val v = 1 -} \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/beforeFunWithNoBlock.kt b/idea/testData/intentions/convertToExpressionBody/beforeFunWithNoBlock.kt deleted file mode 100644 index e489d096904..00000000000 --- a/idea/testData/intentions/convertToExpressionBody/beforeFunWithNoBlock.kt +++ /dev/null @@ -1,3 +0,0 @@ -// "class org.jetbrains.jet.plugin.intentions.ConvertToExpressionBodyAction" "false" - -fun foo() = "abc" \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/beforeFunWithUnitType2.kt b/idea/testData/intentions/convertToExpressionBody/beforeFunWithUnitType2.kt deleted file mode 100644 index 3a3cd361eac..00000000000 --- a/idea/testData/intentions/convertToExpressionBody/beforeFunWithUnitType2.kt +++ /dev/null @@ -1,7 +0,0 @@ -// "class org.jetbrains.jet.plugin.intentions.ConvertToExpressionBodyAction" "false" - -fun foo() { - bar() -} - -fun bar(): String = "abc" \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/beforeMultipleStatements.kt b/idea/testData/intentions/convertToExpressionBody/beforeMultipleStatements.kt deleted file mode 100644 index e4686a6269b..00000000000 --- a/idea/testData/intentions/convertToExpressionBody/beforeMultipleStatements.kt +++ /dev/null @@ -1,6 +0,0 @@ -// "class org.jetbrains.jet.plugin.intentions.ConvertToExpressionBodyAction" "false" - -fun foo(): String { - val v = 1 - return "abc" -} \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/beforeReturnWithNoValue.kt b/idea/testData/intentions/convertToExpressionBody/beforeReturnWithNoValue.kt deleted file mode 100644 index cf3a5061950..00000000000 --- a/idea/testData/intentions/convertToExpressionBody/beforeReturnWithNoValue.kt +++ /dev/null @@ -1,5 +0,0 @@ -// "class org.jetbrains.jet.plugin.intentions.ConvertToExpressionBodyAction" "false" - -fun foo() { - return -} \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/beforeWhile.kt b/idea/testData/intentions/convertToExpressionBody/beforeWhile.kt deleted file mode 100644 index d76eece4ca3..00000000000 --- a/idea/testData/intentions/convertToExpressionBody/beforeWhile.kt +++ /dev/null @@ -1,5 +0,0 @@ -// "class org.jetbrains.jet.plugin.intentions.ConvertToExpressionBodyAction" "false" - -fun foo(p: Boolean): String { - while(true) { } -} \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/declaration.kt b/idea/testData/intentions/convertToExpressionBody/declaration.kt new file mode 100644 index 00000000000..564c3d52147 --- /dev/null +++ b/idea/testData/intentions/convertToExpressionBody/declaration.kt @@ -0,0 +1,5 @@ +// IS_APPLICABLE: false + +fun foo() { + val v = 1 +} \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/beforeExpressionWithReturns1.kt b/idea/testData/intentions/convertToExpressionBody/expressionWithReturns1.kt similarity index 51% rename from idea/testData/intentions/convertToExpressionBody/beforeExpressionWithReturns1.kt rename to idea/testData/intentions/convertToExpressionBody/expressionWithReturns1.kt index 7026a9bfb12..a8dec334e9b 100644 --- a/idea/testData/intentions/convertToExpressionBody/beforeExpressionWithReturns1.kt +++ b/idea/testData/intentions/convertToExpressionBody/expressionWithReturns1.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.jet.plugin.intentions.ConvertToExpressionBodyAction" "false" +// IS_APPLICABLE: false fun foo(p: Boolean): String { return bar() ?: return "a" diff --git a/idea/testData/intentions/convertToExpressionBody/beforeExpressionWithReturns2.kt b/idea/testData/intentions/convertToExpressionBody/expressionWithReturns2.kt similarity index 57% rename from idea/testData/intentions/convertToExpressionBody/beforeExpressionWithReturns2.kt rename to idea/testData/intentions/convertToExpressionBody/expressionWithReturns2.kt index 48357f1d5eb..81d12807865 100644 --- a/idea/testData/intentions/convertToExpressionBody/beforeExpressionWithReturns2.kt +++ b/idea/testData/intentions/convertToExpressionBody/expressionWithReturns2.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.jet.plugin.intentions.ConvertToExpressionBodyAction" "false" +// IS_APPLICABLE: false fun foo(p: Boolean): String { if (p) { diff --git a/idea/testData/intentions/convertToExpressionBody/beforeFunWithImplicitUnitTypeWithThrow.kt b/idea/testData/intentions/convertToExpressionBody/funWithImplicitUnitTypeWithThrow.kt similarity index 61% rename from idea/testData/intentions/convertToExpressionBody/beforeFunWithImplicitUnitTypeWithThrow.kt rename to idea/testData/intentions/convertToExpressionBody/funWithImplicitUnitTypeWithThrow.kt index 7bb3b998749..bb0d22cbda6 100644 --- a/idea/testData/intentions/convertToExpressionBody/beforeFunWithImplicitUnitTypeWithThrow.kt +++ b/idea/testData/intentions/convertToExpressionBody/funWithImplicitUnitTypeWithThrow.kt @@ -1,4 +1,5 @@ -// "Convert to expression body" "true" +// WITH_RUNTIME + fun foo() { throw UnsupportedOperationException() } diff --git a/idea/testData/intentions/convertToExpressionBody/afterFunWithUnitTypeWithThrow.kt b/idea/testData/intentions/convertToExpressionBody/funWithImplicitUnitTypeWithThrow.kt.after similarity index 58% rename from idea/testData/intentions/convertToExpressionBody/afterFunWithUnitTypeWithThrow.kt rename to idea/testData/intentions/convertToExpressionBody/funWithImplicitUnitTypeWithThrow.kt.after index 979286879a2..e42c1a944e0 100644 --- a/idea/testData/intentions/convertToExpressionBody/afterFunWithUnitTypeWithThrow.kt +++ b/idea/testData/intentions/convertToExpressionBody/funWithImplicitUnitTypeWithThrow.kt.after @@ -1,2 +1,3 @@ -// "Convert to expression body" "true" +// WITH_RUNTIME + fun foo(): Unit = throw UnsupportedOperationException() diff --git a/idea/testData/intentions/convertToExpressionBody/funWithNoBlock.kt b/idea/testData/intentions/convertToExpressionBody/funWithNoBlock.kt new file mode 100644 index 00000000000..416bf972359 --- /dev/null +++ b/idea/testData/intentions/convertToExpressionBody/funWithNoBlock.kt @@ -0,0 +1,3 @@ +// IS_APPLICABLE: false + +fun foo() = "abc" \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/beforeFunWithNothingType.kt b/idea/testData/intentions/convertToExpressionBody/funWithNothingType.kt similarity index 64% rename from idea/testData/intentions/convertToExpressionBody/beforeFunWithNothingType.kt rename to idea/testData/intentions/convertToExpressionBody/funWithNothingType.kt index fa1eae93a9e..ff085818522 100644 --- a/idea/testData/intentions/convertToExpressionBody/beforeFunWithNothingType.kt +++ b/idea/testData/intentions/convertToExpressionBody/funWithNothingType.kt @@ -1,4 +1,5 @@ -// "Convert to expression body" "true" +// WITH_RUNTIME + fun foo(): Nothing { throw UnsupportedOperationException() } diff --git a/idea/testData/intentions/convertToExpressionBody/afterFunWithNothingType.kt b/idea/testData/intentions/convertToExpressionBody/funWithNothingType.kt.after similarity index 60% rename from idea/testData/intentions/convertToExpressionBody/afterFunWithNothingType.kt rename to idea/testData/intentions/convertToExpressionBody/funWithNothingType.kt.after index c6631a2d179..c055e8d8ec3 100644 --- a/idea/testData/intentions/convertToExpressionBody/afterFunWithNothingType.kt +++ b/idea/testData/intentions/convertToExpressionBody/funWithNothingType.kt.after @@ -1,2 +1,3 @@ -// "Convert to expression body" "true" +// WITH_RUNTIME + fun foo(): Nothing = throw UnsupportedOperationException() diff --git a/idea/testData/intentions/convertToExpressionBody/beforeFunWithReturn.kt b/idea/testData/intentions/convertToExpressionBody/funWithReturn.kt similarity index 53% rename from idea/testData/intentions/convertToExpressionBody/beforeFunWithReturn.kt rename to idea/testData/intentions/convertToExpressionBody/funWithReturn.kt index 340ff584cc0..db097d708c8 100644 --- a/idea/testData/intentions/convertToExpressionBody/beforeFunWithReturn.kt +++ b/idea/testData/intentions/convertToExpressionBody/funWithReturn.kt @@ -1,4 +1,3 @@ -// "Convert to expression body" "true" fun foo(): String { return "abc" } \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/funWithReturn.kt.after b/idea/testData/intentions/convertToExpressionBody/funWithReturn.kt.after new file mode 100644 index 00000000000..1b12b36524c --- /dev/null +++ b/idea/testData/intentions/convertToExpressionBody/funWithReturn.kt.after @@ -0,0 +1 @@ +fun foo(): String = "abc" \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/beforeFunWithUnitType.kt b/idea/testData/intentions/convertToExpressionBody/funWithUnitType.kt similarity index 53% rename from idea/testData/intentions/convertToExpressionBody/beforeFunWithUnitType.kt rename to idea/testData/intentions/convertToExpressionBody/funWithUnitType.kt index 7cf6c2e0694..3512548b61e 100644 --- a/idea/testData/intentions/convertToExpressionBody/beforeFunWithUnitType.kt +++ b/idea/testData/intentions/convertToExpressionBody/funWithUnitType.kt @@ -1,4 +1,3 @@ -// "Convert to expression body" "true" fun foo() { bar() } diff --git a/idea/testData/intentions/convertToExpressionBody/funWithUnitType.kt.after b/idea/testData/intentions/convertToExpressionBody/funWithUnitType.kt.after new file mode 100644 index 00000000000..c77b79bf82d --- /dev/null +++ b/idea/testData/intentions/convertToExpressionBody/funWithUnitType.kt.after @@ -0,0 +1,3 @@ +fun foo() = bar() + +fun bar() { } \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/funWithUnitType2.kt b/idea/testData/intentions/convertToExpressionBody/funWithUnitType2.kt new file mode 100644 index 00000000000..ffbebeec3a3 --- /dev/null +++ b/idea/testData/intentions/convertToExpressionBody/funWithUnitType2.kt @@ -0,0 +1,7 @@ +// IS_APPLICABLE: false + +fun foo() { + bar() +} + +fun bar(): String = "abc" \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/beforeFunWithUnitTypeWithThrow.kt b/idea/testData/intentions/convertToExpressionBody/funWithUnitTypeWithThrow.kt similarity index 63% rename from idea/testData/intentions/convertToExpressionBody/beforeFunWithUnitTypeWithThrow.kt rename to idea/testData/intentions/convertToExpressionBody/funWithUnitTypeWithThrow.kt index 5f4a30c6f4a..b0f8976593a 100644 --- a/idea/testData/intentions/convertToExpressionBody/beforeFunWithUnitTypeWithThrow.kt +++ b/idea/testData/intentions/convertToExpressionBody/funWithUnitTypeWithThrow.kt @@ -1,4 +1,5 @@ -// "Convert to expression body" "true" +// WITH_RUNTIME + fun foo(): Unit { throw UnsupportedOperationException() } diff --git a/idea/testData/intentions/convertToExpressionBody/afterFunWithImplicitUnitTypeWithThrow.kt b/idea/testData/intentions/convertToExpressionBody/funWithUnitTypeWithThrow.kt.after similarity index 58% rename from idea/testData/intentions/convertToExpressionBody/afterFunWithImplicitUnitTypeWithThrow.kt rename to idea/testData/intentions/convertToExpressionBody/funWithUnitTypeWithThrow.kt.after index 979286879a2..e42c1a944e0 100644 --- a/idea/testData/intentions/convertToExpressionBody/afterFunWithImplicitUnitTypeWithThrow.kt +++ b/idea/testData/intentions/convertToExpressionBody/funWithUnitTypeWithThrow.kt.after @@ -1,2 +1,3 @@ -// "Convert to expression body" "true" +// WITH_RUNTIME + fun foo(): Unit = throw UnsupportedOperationException() diff --git a/idea/testData/intentions/convertToExpressionBody/beforeFunctionLiteral.kt b/idea/testData/intentions/convertToExpressionBody/functionLiteral.kt similarity index 50% rename from idea/testData/intentions/convertToExpressionBody/beforeFunctionLiteral.kt rename to idea/testData/intentions/convertToExpressionBody/functionLiteral.kt index d46b2818f18..c73634d9218 100644 --- a/idea/testData/intentions/convertToExpressionBody/beforeFunctionLiteral.kt +++ b/idea/testData/intentions/convertToExpressionBody/functionLiteral.kt @@ -1,4 +1,4 @@ -// "class org.jetbrains.jet.plugin.intentions.ConvertToExpressionBodyAction" "false" +// IS_APPLICABLE: false fun foo(handler: () -> Unit) { } diff --git a/idea/testData/intentions/convertToExpressionBody/beforeGetWithReturn.kt b/idea/testData/intentions/convertToExpressionBody/getWithReturn.kt similarity index 61% rename from idea/testData/intentions/convertToExpressionBody/beforeGetWithReturn.kt rename to idea/testData/intentions/convertToExpressionBody/getWithReturn.kt index 75f403b5c7d..15a202827fc 100644 --- a/idea/testData/intentions/convertToExpressionBody/beforeGetWithReturn.kt +++ b/idea/testData/intentions/convertToExpressionBody/getWithReturn.kt @@ -1,4 +1,3 @@ -// "Convert to expression body" "true" val foo: String get() { return "abc" diff --git a/idea/testData/intentions/convertToExpressionBody/getWithReturn.kt.after b/idea/testData/intentions/convertToExpressionBody/getWithReturn.kt.after new file mode 100644 index 00000000000..5b4d520373a --- /dev/null +++ b/idea/testData/intentions/convertToExpressionBody/getWithReturn.kt.after @@ -0,0 +1,2 @@ +val foo: String + get() = "abc" \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/multipleStatements.kt b/idea/testData/intentions/convertToExpressionBody/multipleStatements.kt new file mode 100644 index 00000000000..796fcdcdfcf --- /dev/null +++ b/idea/testData/intentions/convertToExpressionBody/multipleStatements.kt @@ -0,0 +1,6 @@ +// IS_APPLICABLE: false + +fun foo(): String { + val v = 1 + return "abc" +} \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/returnWithNoValue.kt b/idea/testData/intentions/convertToExpressionBody/returnWithNoValue.kt new file mode 100644 index 00000000000..cfca0c58bff --- /dev/null +++ b/idea/testData/intentions/convertToExpressionBody/returnWithNoValue.kt @@ -0,0 +1,5 @@ +// IS_APPLICABLE: false + +fun foo() { + return +} \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/while.kt b/idea/testData/intentions/convertToExpressionBody/while.kt new file mode 100644 index 00000000000..0743f794492 --- /dev/null +++ b/idea/testData/intentions/convertToExpressionBody/while.kt @@ -0,0 +1,5 @@ +// IS_APPLICABLE: false + +fun foo(p: Boolean): String { + while(true) { } +} \ No newline at end of file diff --git a/idea/testData/intentions/convertToForEachFunctionCall/.intention b/idea/testData/intentions/convertToForEachFunctionCall/.intention new file mode 100644 index 00000000000..cee391af38a --- /dev/null +++ b/idea/testData/intentions/convertToForEachFunctionCall/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.ConvertToForEachFunctionCallIntention \ No newline at end of file diff --git a/idea/testData/intentions/convertToForEachLoop/.intention b/idea/testData/intentions/convertToForEachLoop/.intention new file mode 100644 index 00000000000..faaf580c9e4 --- /dev/null +++ b/idea/testData/intentions/convertToForEachLoop/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.ConvertToForEachLoopIntention \ No newline at end of file diff --git a/idea/testData/intentions/convertToStringTemplateIntention/.intention b/idea/testData/intentions/convertToStringTemplateIntention/.intention new file mode 100644 index 00000000000..c5f85017e94 --- /dev/null +++ b/idea/testData/intentions/convertToStringTemplateIntention/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.ConvertToStringTemplateIntention \ No newline at end of file diff --git a/idea/testData/intentions/declarations/convertMemberToExtension/.intention b/idea/testData/intentions/declarations/convertMemberToExtension/.intention new file mode 100644 index 00000000000..aebc7d15209 --- /dev/null +++ b/idea/testData/intentions/declarations/convertMemberToExtension/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.declarations.ConvertMemberToExtension \ No newline at end of file diff --git a/idea/testData/intentions/declarations/split/.intention b/idea/testData/intentions/declarations/split/.intention new file mode 100644 index 00000000000..6bb369b0a35 --- /dev/null +++ b/idea/testData/intentions/declarations/split/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.declarations.SplitPropertyDeclarationIntention \ No newline at end of file diff --git a/idea/testData/intentions/insertCurlyBracesToTemplate/.intention b/idea/testData/intentions/insertCurlyBracesToTemplate/.intention new file mode 100644 index 00000000000..323106fc920 --- /dev/null +++ b/idea/testData/intentions/insertCurlyBracesToTemplate/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.InsertCurlyBracesToTemplateIntention \ No newline at end of file diff --git a/idea/testData/intentions/insertExplicitTypeArguments/.intention b/idea/testData/intentions/insertExplicitTypeArguments/.intention new file mode 100644 index 00000000000..b6bacfe5b12 --- /dev/null +++ b/idea/testData/intentions/insertExplicitTypeArguments/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.InsertExplicitTypeArguments \ No newline at end of file diff --git a/idea/testData/intentions/invertIfCondition/.intention b/idea/testData/intentions/invertIfCondition/.intention new file mode 100644 index 00000000000..697b9b32f49 --- /dev/null +++ b/idea/testData/intentions/invertIfCondition/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.InvertIfConditionIntention \ No newline at end of file diff --git a/idea/testData/intentions/makeTypeExplicitInLambda/.intention b/idea/testData/intentions/makeTypeExplicitInLambda/.intention new file mode 100644 index 00000000000..e8035a85ba3 --- /dev/null +++ b/idea/testData/intentions/makeTypeExplicitInLambda/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.MakeTypeExplicitInLambdaIntention \ No newline at end of file diff --git a/idea/testData/intentions/makeTypeImplicitInLambda/.intention b/idea/testData/intentions/makeTypeImplicitInLambda/.intention new file mode 100644 index 00000000000..65aef85236c --- /dev/null +++ b/idea/testData/intentions/makeTypeImplicitInLambda/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.MakeTypeImplicitInLambdaIntention \ No newline at end of file diff --git a/idea/testData/intentions/moveLambdaInsideParentheses/.intention b/idea/testData/intentions/moveLambdaInsideParentheses/.intention new file mode 100644 index 00000000000..e1430b712f9 --- /dev/null +++ b/idea/testData/intentions/moveLambdaInsideParentheses/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.MoveLambdaInsideParenthesesIntention \ No newline at end of file diff --git a/idea/testData/intentions/moveLambdaOutsideParentheses/.intention b/idea/testData/intentions/moveLambdaOutsideParentheses/.intention new file mode 100644 index 00000000000..18aae3a81b8 --- /dev/null +++ b/idea/testData/intentions/moveLambdaOutsideParentheses/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.MoveLambdaOutsideParenthesesIntention \ No newline at end of file diff --git a/idea/testData/intentions/operatorToFunction/.intention b/idea/testData/intentions/operatorToFunction/.intention new file mode 100644 index 00000000000..1279518796b --- /dev/null +++ b/idea/testData/intentions/operatorToFunction/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.OperatorToFunctionIntention \ No newline at end of file diff --git a/idea/testData/intentions/reconstructedType/.intention b/idea/testData/intentions/reconstructedType/.intention new file mode 100644 index 00000000000..58683baeb5d --- /dev/null +++ b/idea/testData/intentions/reconstructedType/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.ReconstructTypeInCastOrIsAction \ No newline at end of file diff --git a/idea/testData/intentions/removeBraces/.intention b/idea/testData/intentions/removeBraces/.intention new file mode 100644 index 00000000000..5efaa355404 --- /dev/null +++ b/idea/testData/intentions/removeBraces/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.RemoveBracesIntention \ No newline at end of file diff --git a/idea/testData/intentions/removeCurlyBracesFromTemplate/.intention b/idea/testData/intentions/removeCurlyBracesFromTemplate/.intention new file mode 100644 index 00000000000..107e3edeba5 --- /dev/null +++ b/idea/testData/intentions/removeCurlyBracesFromTemplate/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.RemoveCurlyBracesFromTemplateIntention \ No newline at end of file diff --git a/idea/testData/intentions/removeExplicitTypeArguments/.intention b/idea/testData/intentions/removeExplicitTypeArguments/.intention new file mode 100644 index 00000000000..a48847af45b --- /dev/null +++ b/idea/testData/intentions/removeExplicitTypeArguments/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.RemoveExplicitTypeArguments \ No newline at end of file diff --git a/idea/testData/intentions/removeUnnecessaryParentheses/.intention b/idea/testData/intentions/removeUnnecessaryParentheses/.intention new file mode 100644 index 00000000000..63b52ba1e82 --- /dev/null +++ b/idea/testData/intentions/removeUnnecessaryParentheses/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.RemoveUnnecessaryParenthesesIntention \ No newline at end of file diff --git a/idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt/.intention b/idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt/.intention new file mode 100644 index 00000000000..659ab16942d --- /dev/null +++ b/idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.ReplaceExplicitFunctionLiteralParamWithItIntention \ No newline at end of file diff --git a/idea/testData/intentions/replaceItWithExplicitFunctionLiteralParam/.intention b/idea/testData/intentions/replaceItWithExplicitFunctionLiteralParam/.intention new file mode 100644 index 00000000000..872a1cdbb06 --- /dev/null +++ b/idea/testData/intentions/replaceItWithExplicitFunctionLiteralParam/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.ReplaceItWithExplicitFunctionLiteralParamIntention \ No newline at end of file diff --git a/idea/testData/intentions/replaceWithDotQualifiedMethodCall/.intention b/idea/testData/intentions/replaceWithDotQualifiedMethodCall/.intention new file mode 100644 index 00000000000..b5479e69eaf --- /dev/null +++ b/idea/testData/intentions/replaceWithDotQualifiedMethodCall/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.ReplaceWithDotQualifiedMethodCallIntention \ No newline at end of file diff --git a/idea/testData/intentions/replaceWithInfixFunctionCall/.intention b/idea/testData/intentions/replaceWithInfixFunctionCall/.intention new file mode 100644 index 00000000000..69b20b1d210 --- /dev/null +++ b/idea/testData/intentions/replaceWithInfixFunctionCall/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.TestableReplaceWithInfixFunctionCallIntention \ No newline at end of file diff --git a/idea/testData/intentions/replaceWithOperatorAssign/.intention b/idea/testData/intentions/replaceWithOperatorAssign/.intention new file mode 100644 index 00000000000..11fdcb93572 --- /dev/null +++ b/idea/testData/intentions/replaceWithOperatorAssign/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.ReplaceWithOperatorAssignIntention \ No newline at end of file diff --git a/idea/testData/intentions/replaceWithTraditionalAssignment/.intention b/idea/testData/intentions/replaceWithTraditionalAssignment/.intention new file mode 100644 index 00000000000..bd4409e2df8 --- /dev/null +++ b/idea/testData/intentions/replaceWithTraditionalAssignment/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.ReplaceWithTraditionalAssignmentIntention \ No newline at end of file diff --git a/idea/testData/intentions/simplifyBooleanWithConstants/.intention b/idea/testData/intentions/simplifyBooleanWithConstants/.intention new file mode 100644 index 00000000000..9430cafd718 --- /dev/null +++ b/idea/testData/intentions/simplifyBooleanWithConstants/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.SimplifyBooleanWithConstantsIntention \ No newline at end of file diff --git a/idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/.intention b/idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/.intention new file mode 100644 index 00000000000..7a583219a69 --- /dev/null +++ b/idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.SimplifyNegatedBinaryExpressionIntention \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/.intention b/idea/testData/intentions/specifyType/.intention new file mode 100644 index 00000000000..a4e94a0e2be --- /dev/null +++ b/idea/testData/intentions/specifyType/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.SpecifyTypeExplicitlyAction \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/afterBadCaretPosition.kt b/idea/testData/intentions/specifyType/afterBadCaretPosition.kt deleted file mode 100644 index c065b032efa..00000000000 --- a/idea/testData/intentions/specifyType/afterBadCaretPosition.kt +++ /dev/null @@ -1,3 +0,0 @@ -// "class org.jetbrains.jet.plugin.intentions.SpecifyTypeExplicitlyAction" "false" - -val x = "" \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/afterOnType.kt b/idea/testData/intentions/specifyType/afterOnType.kt deleted file mode 100644 index 03ecd94672d..00000000000 --- a/idea/testData/intentions/specifyType/afterOnType.kt +++ /dev/null @@ -1,3 +0,0 @@ -// "Remove explicitly specified type" "true" - -val x = null \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/afterPublicMember.kt b/idea/testData/intentions/specifyType/afterPublicMember.kt deleted file mode 100644 index 4bca127d49c..00000000000 --- a/idea/testData/intentions/specifyType/afterPublicMember.kt +++ /dev/null @@ -1,7 +0,0 @@ -// "Specify type explicitly" "false" - -class A { - public fun foo() { - return "" - } -} diff --git a/idea/testData/intentions/specifyType/afterRemoveUnresolvedType.kt b/idea/testData/intentions/specifyType/afterRemoveUnresolvedType.kt deleted file mode 100644 index 5e39d29ac69..00000000000 --- a/idea/testData/intentions/specifyType/afterRemoveUnresolvedType.kt +++ /dev/null @@ -1,4 +0,0 @@ -// "Remove explicitly specified type" "true" -package testing - -val a = 12 \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/afterTypeAlreadyProvided.kt b/idea/testData/intentions/specifyType/afterTypeAlreadyProvided.kt deleted file mode 100644 index a4666865f87..00000000000 --- a/idea/testData/intentions/specifyType/afterTypeAlreadyProvided.kt +++ /dev/null @@ -1,2 +0,0 @@ -// "Remove explicitly specified type" "true" -val x = "" \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/afterUnitType.kt b/idea/testData/intentions/specifyType/afterUnitType.kt deleted file mode 100644 index 15e9b5890f8..00000000000 --- a/idea/testData/intentions/specifyType/afterUnitType.kt +++ /dev/null @@ -1,2 +0,0 @@ -// "Specify type explicitly" "true" -val x: Unit = Unit.VALUE \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/afterUnknownType.kt b/idea/testData/intentions/specifyType/afterUnknownType.kt deleted file mode 100644 index f148fbdc44b..00000000000 --- a/idea/testData/intentions/specifyType/afterUnknownType.kt +++ /dev/null @@ -1,3 +0,0 @@ -// "class org.jetbrains.jet.plugin.intentions.SpecifyTypeExplicitlyAction" "false" - -val x = BadType() \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/badCaretPosition.kt b/idea/testData/intentions/specifyType/badCaretPosition.kt new file mode 100644 index 00000000000..00c028d20be --- /dev/null +++ b/idea/testData/intentions/specifyType/badCaretPosition.kt @@ -0,0 +1,3 @@ +// IS_APPLICABLE: false + +val x = "" \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/beforeBadCaretPosition.kt b/idea/testData/intentions/specifyType/beforeBadCaretPosition.kt deleted file mode 100644 index c065b032efa..00000000000 --- a/idea/testData/intentions/specifyType/beforeBadCaretPosition.kt +++ /dev/null @@ -1,3 +0,0 @@ -// "class org.jetbrains.jet.plugin.intentions.SpecifyTypeExplicitlyAction" "false" - -val x = "" \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/beforeFunctionType.kt b/idea/testData/intentions/specifyType/beforeFunctionType.kt deleted file mode 100644 index 44d3a0120e9..00000000000 --- a/idea/testData/intentions/specifyType/beforeFunctionType.kt +++ /dev/null @@ -1,2 +0,0 @@ -// "Specify type explicitly" "true" -val x = { (a: Int) -> ""} \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/beforeOnType.kt b/idea/testData/intentions/specifyType/beforeOnType.kt deleted file mode 100644 index 8a641dee9fe..00000000000 --- a/idea/testData/intentions/specifyType/beforeOnType.kt +++ /dev/null @@ -1,3 +0,0 @@ -// "Remove explicitly specified type" "true" - -val x : Map.Entryng, Int>? = null \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/beforePublicMember.kt b/idea/testData/intentions/specifyType/beforePublicMember.kt deleted file mode 100644 index 4bca127d49c..00000000000 --- a/idea/testData/intentions/specifyType/beforePublicMember.kt +++ /dev/null @@ -1,7 +0,0 @@ -// "Specify type explicitly" "false" - -class A { - public fun foo() { - return "" - } -} diff --git a/idea/testData/intentions/specifyType/beforeRemoveUnresolvedType.kt b/idea/testData/intentions/specifyType/beforeRemoveUnresolvedType.kt deleted file mode 100644 index c46cbc7b442..00000000000 --- a/idea/testData/intentions/specifyType/beforeRemoveUnresolvedType.kt +++ /dev/null @@ -1,4 +0,0 @@ -// "Remove explicitly specified type" "true" -package testing - -val a: Bad = 12 \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/beforeStringRedefined.kt b/idea/testData/intentions/specifyType/beforeStringRedefined.kt deleted file mode 100644 index 44bc26613a2..00000000000 --- a/idea/testData/intentions/specifyType/beforeStringRedefined.kt +++ /dev/null @@ -1,4 +0,0 @@ -// "Specify type explicitly" "true" -class String {} - -val x = "" \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/beforeTypeAlreadyProvided.kt b/idea/testData/intentions/specifyType/beforeTypeAlreadyProvided.kt deleted file mode 100644 index 00ee7905d1e..00000000000 --- a/idea/testData/intentions/specifyType/beforeTypeAlreadyProvided.kt +++ /dev/null @@ -1,2 +0,0 @@ -// "Remove explicitly specified type" "true" -val x : String = "" \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/beforeUnitType.kt b/idea/testData/intentions/specifyType/beforeUnitType.kt deleted file mode 100644 index e6de0877f15..00000000000 --- a/idea/testData/intentions/specifyType/beforeUnitType.kt +++ /dev/null @@ -1,2 +0,0 @@ -// "Specify type explicitly" "true" -val x = Unit.VALUE \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/beforeUnknownType.kt b/idea/testData/intentions/specifyType/beforeUnknownType.kt deleted file mode 100644 index f148fbdc44b..00000000000 --- a/idea/testData/intentions/specifyType/beforeUnknownType.kt +++ /dev/null @@ -1,3 +0,0 @@ -// "class org.jetbrains.jet.plugin.intentions.SpecifyTypeExplicitlyAction" "false" - -val x = BadType() \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/beforeClassNameClashing.kt b/idea/testData/intentions/specifyType/classNameClashing.kt similarity index 72% rename from idea/testData/intentions/specifyType/beforeClassNameClashing.kt rename to idea/testData/intentions/specifyType/classNameClashing.kt index 7ad7250abc3..7f1bffeaf9b 100644 --- a/idea/testData/intentions/specifyType/beforeClassNameClashing.kt +++ b/idea/testData/intentions/specifyType/classNameClashing.kt @@ -1,5 +1,7 @@ -// "Specify type explicitly" "true" +// WITH_RUNTIME + fun getEntry() : Map.Entry, java.sql.Array> { + throw Error() } val x = getEntry() \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/afterClassNameClashing.kt b/idea/testData/intentions/specifyType/classNameClashing.kt.after similarity index 79% rename from idea/testData/intentions/specifyType/afterClassNameClashing.kt rename to idea/testData/intentions/specifyType/classNameClashing.kt.after index c911722c454..83d9ec6f01c 100644 --- a/idea/testData/intentions/specifyType/afterClassNameClashing.kt +++ b/idea/testData/intentions/specifyType/classNameClashing.kt.after @@ -1,7 +1,9 @@ -// "Specify type explicitly" "true" +// WITH_RUNTIME + import java.sql fun getEntry() : Map.Entry, java.sql.Array> { + throw Error() } val x: Map.Entry, sql.Array> = getEntry() \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/beforeEnumType.kt b/idea/testData/intentions/specifyType/enumType.kt similarity index 60% rename from idea/testData/intentions/specifyType/beforeEnumType.kt rename to idea/testData/intentions/specifyType/enumType.kt index c5d6cb246b5..ec46b66c548 100644 --- a/idea/testData/intentions/specifyType/beforeEnumType.kt +++ b/idea/testData/intentions/specifyType/enumType.kt @@ -1,4 +1,3 @@ -// "Specify type explicitly" "true" enum class MyEnum { E1 E2 } diff --git a/idea/testData/intentions/specifyType/afterEnumType.kt b/idea/testData/intentions/specifyType/enumType.kt.after similarity index 60% rename from idea/testData/intentions/specifyType/afterEnumType.kt rename to idea/testData/intentions/specifyType/enumType.kt.after index de155fdbe75..63b41a52c06 100644 --- a/idea/testData/intentions/specifyType/afterEnumType.kt +++ b/idea/testData/intentions/specifyType/enumType.kt.after @@ -1,4 +1,3 @@ -// "Specify type explicitly" "true" enum class MyEnum { E1 E2 } diff --git a/idea/testData/intentions/specifyType/functionType.kt b/idea/testData/intentions/specifyType/functionType.kt new file mode 100644 index 00000000000..9bf79bd87a9 --- /dev/null +++ b/idea/testData/intentions/specifyType/functionType.kt @@ -0,0 +1 @@ +val x = { (a: Int) -> ""} \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/afterFunctionType.kt b/idea/testData/intentions/specifyType/functionType.kt.after similarity index 53% rename from idea/testData/intentions/specifyType/afterFunctionType.kt rename to idea/testData/intentions/specifyType/functionType.kt.after index e9bff56789e..fe8ee5809c5 100644 --- a/idea/testData/intentions/specifyType/afterFunctionType.kt +++ b/idea/testData/intentions/specifyType/functionType.kt.after @@ -1,2 +1 @@ -// "Specify type explicitly" "true" val x: (Int) -> String = { (a: Int) -> ""} \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/beforeLoopParameter.kt b/idea/testData/intentions/specifyType/loopParameter.kt similarity index 76% rename from idea/testData/intentions/specifyType/beforeLoopParameter.kt rename to idea/testData/intentions/specifyType/loopParameter.kt index 00f625d9dd8..faae679560e 100644 --- a/idea/testData/intentions/specifyType/beforeLoopParameter.kt +++ b/idea/testData/intentions/specifyType/loopParameter.kt @@ -1,4 +1,5 @@ -// "Specify type explicitly" "true" +// WITH_RUNTIME + import java.util.HashMap fun foo(map : HashMap) { diff --git a/idea/testData/intentions/specifyType/afterLoopParameter.kt b/idea/testData/intentions/specifyType/loopParameter.kt.after similarity index 80% rename from idea/testData/intentions/specifyType/afterLoopParameter.kt rename to idea/testData/intentions/specifyType/loopParameter.kt.after index 3c80b9ea06b..32f4f937299 100644 --- a/idea/testData/intentions/specifyType/afterLoopParameter.kt +++ b/idea/testData/intentions/specifyType/loopParameter.kt.after @@ -1,4 +1,5 @@ -// "Specify type explicitly" "true" +// WITH_RUNTIME + import java.util.HashMap fun foo(map : HashMap) { diff --git a/idea/testData/intentions/specifyType/onType.kt b/idea/testData/intentions/specifyType/onType.kt new file mode 100644 index 00000000000..61e290efb06 --- /dev/null +++ b/idea/testData/intentions/specifyType/onType.kt @@ -0,0 +1 @@ +val x : Map.Entryng, Int>? = null \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/onType.kt.after b/idea/testData/intentions/specifyType/onType.kt.after new file mode 100644 index 00000000000..389aa3b678c --- /dev/null +++ b/idea/testData/intentions/specifyType/onType.kt.after @@ -0,0 +1 @@ +val x = null \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/publicMember.kt b/idea/testData/intentions/specifyType/publicMember.kt new file mode 100644 index 00000000000..4286e2c8dfc --- /dev/null +++ b/idea/testData/intentions/specifyType/publicMember.kt @@ -0,0 +1,9 @@ +// IS_APPLICABLE: false +// WITH_RUNTIME +// ERROR: Type mismatch.
Required:kotlin.Unit
Found:kotlin.String
+ +class A { + public fun foo() { + return "" + } +} diff --git a/idea/testData/intentions/specifyType/removeUnresolvedType.kt b/idea/testData/intentions/specifyType/removeUnresolvedType.kt new file mode 100644 index 00000000000..7b03bb4e459 --- /dev/null +++ b/idea/testData/intentions/specifyType/removeUnresolvedType.kt @@ -0,0 +1,6 @@ +// WITH_RUNTIME +// ERROR: Unresolved reference: Bad + +package testing + +val a: Bad = 12 \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/removeUnresolvedType.kt.after b/idea/testData/intentions/specifyType/removeUnresolvedType.kt.after new file mode 100644 index 00000000000..339cc60ec50 --- /dev/null +++ b/idea/testData/intentions/specifyType/removeUnresolvedType.kt.after @@ -0,0 +1,6 @@ +// WITH_RUNTIME +// ERROR: Unresolved reference: Bad + +package testing + +val a = 12 \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/stringRedefined.kt b/idea/testData/intentions/specifyType/stringRedefined.kt new file mode 100644 index 00000000000..3fbcf12974c --- /dev/null +++ b/idea/testData/intentions/specifyType/stringRedefined.kt @@ -0,0 +1,3 @@ +class String {} + +val x = "" \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/afterStringRedefined.kt b/idea/testData/intentions/specifyType/stringRedefined.kt.after similarity index 53% rename from idea/testData/intentions/specifyType/afterStringRedefined.kt rename to idea/testData/intentions/specifyType/stringRedefined.kt.after index 3701ff3ecd9..d3d6f814b4d 100644 --- a/idea/testData/intentions/specifyType/afterStringRedefined.kt +++ b/idea/testData/intentions/specifyType/stringRedefined.kt.after @@ -1,4 +1,3 @@ -// "Specify type explicitly" "true" class String {} val x: kotlin.String = "" \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/typeAlreadyProvided.kt b/idea/testData/intentions/specifyType/typeAlreadyProvided.kt new file mode 100644 index 00000000000..305f8c0cad9 --- /dev/null +++ b/idea/testData/intentions/specifyType/typeAlreadyProvided.kt @@ -0,0 +1 @@ +val x : String = "" \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/typeAlreadyProvided.kt.after b/idea/testData/intentions/specifyType/typeAlreadyProvided.kt.after new file mode 100644 index 00000000000..e78c75c1020 --- /dev/null +++ b/idea/testData/intentions/specifyType/typeAlreadyProvided.kt.after @@ -0,0 +1 @@ +val x = "" \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/unitType.kt b/idea/testData/intentions/specifyType/unitType.kt new file mode 100644 index 00000000000..bd24acedade --- /dev/null +++ b/idea/testData/intentions/specifyType/unitType.kt @@ -0,0 +1 @@ +val x = Unit.VALUE \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/unitType.kt.after b/idea/testData/intentions/specifyType/unitType.kt.after new file mode 100644 index 00000000000..eed5f8f383b --- /dev/null +++ b/idea/testData/intentions/specifyType/unitType.kt.after @@ -0,0 +1 @@ +val x: Unit = Unit.VALUE \ No newline at end of file diff --git a/idea/testData/intentions/specifyType/unknownType.kt b/idea/testData/intentions/specifyType/unknownType.kt new file mode 100644 index 00000000000..2446e7d9d60 --- /dev/null +++ b/idea/testData/intentions/specifyType/unknownType.kt @@ -0,0 +1,5 @@ +// IS_APPLICABLE: false +// WITH_RUNTIME +// ERROR: Unresolved reference: BadType + +val x = BadType() \ No newline at end of file diff --git a/idea/testData/intentions/splitIf/.intention b/idea/testData/intentions/splitIf/.intention new file mode 100644 index 00000000000..47fac2d6c70 --- /dev/null +++ b/idea/testData/intentions/splitIf/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.SplitIfIntention \ No newline at end of file diff --git a/idea/testData/intentions/swapBinaryExpression/.intention b/idea/testData/intentions/swapBinaryExpression/.intention new file mode 100644 index 00000000000..452ff1b26f7 --- /dev/null +++ b/idea/testData/intentions/swapBinaryExpression/.intention @@ -0,0 +1 @@ +org.jetbrains.jet.plugin.intentions.SwapBinaryExpression \ No newline at end of file diff --git a/idea/tests/org/jetbrains/jet/plugin/intentions/AbstractCodeTransformationTest.java b/idea/tests/org/jetbrains/jet/plugin/intentions/AbstractCodeTransformationTest.java index c7df6a3fe21..c7739475e3f 100644 --- a/idea/tests/org/jetbrains/jet/plugin/intentions/AbstractCodeTransformationTest.java +++ b/idea/tests/org/jetbrains/jet/plugin/intentions/AbstractCodeTransformationTest.java @@ -16,277 +16,55 @@ package org.jetbrains.jet.plugin.intentions; -import com.intellij.codeInsight.editorActions.JoinLinesHandler; +import com.google.common.collect.Lists; +import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer; +import com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl; import com.intellij.codeInsight.intention.IntentionAction; -import com.intellij.openapi.editor.actionSystem.EditorActionHandler; -import com.intellij.openapi.projectRoots.JavaSdk; import com.intellij.openapi.projectRoots.Sdk; import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.util.io.FileUtil; import com.intellij.testFramework.LightCodeInsightTestCase; import com.intellij.util.PathUtil; -import org.apache.commons.lang.SystemUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.InTextDirectivesUtils; import org.jetbrains.jet.lang.psi.JetFile; import org.jetbrains.jet.plugin.DirectiveBasedActionUtils; -import org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.*; -import org.jetbrains.jet.plugin.intentions.declarations.ConvertMemberToExtension; -import org.jetbrains.jet.plugin.intentions.declarations.SplitPropertyDeclarationIntention; +import org.jetbrains.jet.plugin.PluginTestCaseBase; import org.jetbrains.jet.testing.ConfigLibraryUtil; import org.junit.Assert; import java.io.File; +import java.util.List; public abstract class AbstractCodeTransformationTest extends LightCodeInsightTestCase { - public void doTestDoubleBangToIfThen(@NotNull String path) throws Exception { - doTestIntention(path, new DoubleBangToIfThenIntention()); + private static IntentionAction createIntention(File testDataFile) throws Exception { + List candidateFiles = Lists.newArrayList(); + + File current = testDataFile.getParentFile(); + while (current != null) { + File candidate = new File(current, ".intention"); + if (candidate.exists()) { + candidateFiles.add(candidate); + } + current = current.getParentFile(); + } + + if (candidateFiles.isEmpty()) { + throw new AssertionError(".intention file is not found for " + testDataFile + + "\nAdd it to base directory of test data. It should contain fully-qualified name of intention class."); + } + if (candidateFiles.size() > 1) { + throw new AssertionError("Several .intention files are available for " + testDataFile + + "\nPlease remove some of them\n" + candidateFiles); + } + + String className = FileUtil.loadFile(candidateFiles.get(0)).trim(); + return (IntentionAction) Class.forName(className).newInstance(); } - public void doTestIfThenToDoubleBang(@NotNull String path) throws Exception { - doTestIntention(path, new IfThenToDoubleBangIntention()); - } + protected void doTest(@NotNull String path) throws Exception { + IntentionAction intentionAction = createIntention(new File(path)); - public void doTestElvisToIfThen(@NotNull String path) throws Exception { - doTestIntention(path, new ElvisToIfThenIntention()); - } - - public void doTestIfThenToElvis(@NotNull String path) throws Exception { - doTestIntention(path, new IfThenToElvisIntention()); - } - - public void doTestSafeAccessToIfThen(@NotNull String path) throws Exception { - doTestIntention(path, new SafeAccessToIfThenIntention()); - } - - public void doTestIfThenToSafeAccess(@NotNull String path) throws Exception { - doTestIntention(path, new IfThenToSafeAccessIntention()); - } - - public void doTestConvertToStringTemplate(@NotNull String path) throws Exception { - doTestIntention(path, new ConvertToStringTemplateIntention()); - } - - public void doTestConvertToConcatenatedStringIntention(@NotNull String path) throws Exception { - doTestIntention(path, new ConvertToConcatenatedStringIntention()); - } - - public void doTestFoldIfToAssignment(@NotNull String path) throws Exception { - doTestIntention(path, new FoldIfToAssignmentIntention()); - } - - public void doTestFoldIfToReturn(@NotNull String path) throws Exception { - doTestIntention(path, new FoldIfToReturnIntention()); - } - - public void doTestFoldIfToReturnAsymmetrically(@NotNull String path) throws Exception { - doTestIntention(path, new FoldIfToReturnAsymmetricallyIntention()); - } - - public void doTestFoldWhenToAssignment(@NotNull String path) throws Exception { - doTestIntention(path, new FoldWhenToAssignmentIntention()); - } - - public void doTestFoldWhenToReturn(@NotNull String path) throws Exception { - doTestIntention(path, new FoldWhenToReturnIntention()); - } - - public void doTestUnfoldAssignmentToIf(@NotNull String path) throws Exception { - doTestIntention(path, new UnfoldAssignmentToIfIntention()); - } - - public void doTestUnfoldAssignmentToWhen(@NotNull String path) throws Exception { - doTestIntention(path, new UnfoldAssignmentToWhenIntention()); - } - - public void doTestUnfoldPropertyToIf(@NotNull String path) throws Exception { - doTestIntention(path, new UnfoldPropertyToIfIntention()); - } - - public void doTestUnfoldPropertyToWhen(@NotNull String path) throws Exception { - doTestIntention(path, new UnfoldPropertyToWhenIntention()); - } - - public void doTestUnfoldReturnToIf(@NotNull String path) throws Exception { - doTestIntention(path, new UnfoldReturnToIfIntention()); - } - - public void doTestUnfoldReturnToWhen(@NotNull String path) throws Exception { - doTestIntention(path, new UnfoldReturnToWhenIntention()); - } - - public void doTestIfToWhen(@NotNull String path) throws Exception { - doTestIntention(path, new IfToWhenIntention()); - } - - public void doTestWhenToIf(@NotNull String path) throws Exception { - doTestIntention(path, new WhenToIfIntention()); - } - - public void doTestFlattenWhen(@NotNull String path) throws Exception { - doTestIntention(path, new FlattenWhenIntention()); - } - - public void doTestMergeWhen(@NotNull String path) throws Exception { - doTestIntention(path, new MergeWhenIntention()); - } - - public void doTestIntroduceWhenSubject(@NotNull String path) throws Exception { - doTestIntention(path, new IntroduceWhenSubjectIntention()); - } - - public void doTestEliminateWhenSubject(@NotNull String path) throws Exception { - doTestIntention(path, new EliminateWhenSubjectIntention()); - } - - public void doTestSplitProperty(@NotNull String path) throws Exception { - doTestIntention(path, new SplitPropertyDeclarationIntention()); - } - - public void doTestRemoveUnnecessaryParentheses(@NotNull String path) throws Exception { - doTestIntention(path, new RemoveUnnecessaryParenthesesIntention()); - } - - public void doTestRemoveCurlyFromTemplate(@NotNull String path) throws Exception { - doTestIntention(path, new RemoveCurlyBracesFromTemplateIntention()); - } - - public void doTestInsertCurlyToTemplate(@NotNull String path) throws Exception { - doTestIntention(path, new InsertCurlyBracesToTemplateIntention()); - } - - public void doTestMoveLambdaInsideParentheses(@NotNull String path) throws Exception { - doTestIntention(path, new MoveLambdaInsideParenthesesIntention()); - } - public void doTestMoveLambdaOutsideParentheses(@NotNull String path) throws Exception { - doTestIntention(path, new MoveLambdaOutsideParenthesesIntention()); - } - - public void doTestSwapBinaryExpression(@NotNull String path) throws Exception { - doTestIntention(path, new SwapBinaryExpression()); - } - - public void doTestRemoveExplicitTypeArguments(@NotNull String path) throws Exception { - doTestIntention(path, new RemoveExplicitTypeArguments()); - } - - public void doTestConvertMemberToExtension(@NotNull String path) throws Exception { - doTestIntention(path, new ConvertMemberToExtension()); - } - - public void doTestReconstructType(@NotNull String path) throws Exception { - doTestIntention(path, new ReconstructTypeInCastOrIsAction()); - } - - public void doTestReplaceWithDotQualifiedMethodCall(@NotNull String path) throws Exception { - doTestIntention(path, new ReplaceWithDotQualifiedMethodCallIntention()); - } - - public void doTestReplaceWithInfixFunctionCall(@NotNull String path) throws Exception { - doTestIntention(path, new TestableReplaceWithInfixFunctionCallIntention()); - } - - public void doTestReplaceExplicitFunctionLiteralParamWithIt(@NotNull String path) throws Exception { - doTestIntention(path, new ReplaceExplicitFunctionLiteralParamWithItIntention()); - } - - public void doTestConvertNegatedExpressionWithDemorgansLaw(@NotNull String path) throws Exception { - doTestIntention(path, new ConvertNegatedExpressionWithDemorgansLawIntention()); - } - - public void doTestReplaceItWithExplicitFunctionLiteralParam(@NotNull String path) throws Exception { - doTestIntention(path, new ReplaceItWithExplicitFunctionLiteralParamIntention()); - } - - public void doTestRemoveBraces(@NotNull String path) throws Exception { - doTestIntention(path, new RemoveBracesIntention()); - } - - public void doTestAddBraces(@NotNull String path) throws Exception { - doTestIntention(path, new AddBracesIntention()); - } - - public void doTestConvertNegatedBooleanSequence(@NotNull String path) throws Exception { - doTestIntention(path, new ConvertNegatedBooleanSequenceIntention()); - } - - public void doTestReplaceGetIntention(@NotNull String path) throws Exception { - doTestIntention(path, new TestableReplaceGetIntention()); - } - - public void doTestReplaceContainsIntention(@NotNull String path) throws Exception { - doTestIntention(path, new TestableReplaceContainsIntention()); - } - - public void doTestReplaceBinaryInfixIntention(@NotNull String path) throws Exception { - doTestIntention(path, new TestableReplaceBinaryInfixIntention()); - } - - public void doTestReplaceUnaryPrefixIntention(@NotNull String path) throws Exception { - doTestIntention(path, new TestableReplaceUnaryPrefixIntention()); - } - - public void doTestReplaceInvokeIntention(@NotNull String path) throws Exception { - doTestIntention(path, new TestableReplaceInvokeIntention()); - } - - public void doTestSimplifyNegatedBinaryExpressionIntention(@NotNull String path) throws Exception { - doTestIntention(path, new SimplifyNegatedBinaryExpressionIntention()); - } - - public void doTestInsertExplicitTypeArguments(@NotNull String path) throws Exception { - doTestIntention(path, new InsertExplicitTypeArguments()); - } - - public void doTestConvertAssertToIfWithThrowIntention(@NotNull String path) throws Exception { - doTestIntention(path, new ConvertAssertToIfWithThrowIntention()); - } - - public void doTestConvertIfWithThrowToAssertIntention(@NotNull String path) throws Exception { - doTestIntention(path, new ConvertIfWithThrowToAssertIntention()); - } - - public void doTestSplitIf(@NotNull String path) throws Exception { - doTestIntention(path, new SplitIfIntention()); - } - - public void doTestReplaceWithOperatorAssign(@NotNull String path) throws Exception { - doTestIntention(path, new ReplaceWithOperatorAssignIntention()); - } - - public void doTestReplaceWithTraditionalAssignment(@NotNull String path) throws Exception { - doTestIntention(path, new ReplaceWithTraditionalAssignmentIntention()); - } - - public void doTestSimplifyBooleanWithConstants(@NotNull String path) throws Exception { - doTestIntention(path, new SimplifyBooleanWithConstantsIntention()); - } - - public void doTestInvertIfCondition(@NotNull String path) throws Exception { - doTestIntention(path, new InvertIfConditionIntention()); - } - - public void doTestMakeTypeExplicitInLambda(@NotNull String path) throws Exception { - doTestIntention(path, new MakeTypeExplicitInLambdaIntention()); - } - - public void doTestMakeTypeImplicitInLambda(@NotNull String path) throws Exception { - doTestIntention(path, new MakeTypeImplicitInLambdaIntention()); - } - - public void doTestOperatorToFunction(@NotNull String path) throws Exception { - doTestIntention(path, new OperatorToFunctionIntention()); - } - - public void doTestConvertToForEachLoop(@NotNull String path) throws Exception { - doTestIntention(path, new ConvertToForEachLoopIntention()); - } - - public void doTestConvertToForEachFunctionCall(@NotNull String path) throws Exception { - doTestIntention(path, new ConvertToForEachFunctionCallIntention()); - } - - private void doTestIntention(@NotNull String path, @NotNull IntentionAction intentionAction) throws Exception { configureByFile(path); String fileText = FileUtil.loadFile(new File(path), true); @@ -351,6 +129,6 @@ public abstract class AbstractCodeTransformationTest extends LightCodeInsightTes } protected static Sdk getFullJavaJDK() { - return JavaSdk.getInstance().createJdk("JDK", SystemUtils.getJavaHome().getAbsolutePath()); + return PluginTestCaseBase.fullJdk(); } } diff --git a/idea/tests/org/jetbrains/jet/plugin/intentions/AbstractIntentionTest.java b/idea/tests/org/jetbrains/jet/plugin/intentions/AbstractIntentionTest.java deleted file mode 100644 index d28fff12b58..00000000000 --- a/idea/tests/org/jetbrains/jet/plugin/intentions/AbstractIntentionTest.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2010-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.jet.plugin.intentions; - -import org.jetbrains.jet.plugin.quickfix.AbstractQuickFixTest; - -public abstract class AbstractIntentionTest extends AbstractQuickFixTest{ -} diff --git a/idea/tests/org/jetbrains/jet/plugin/intentions/CodeTransformationTestGenerated.java b/idea/tests/org/jetbrains/jet/plugin/intentions/CodeTransformationTestGenerated.java index 0117f22947d..406aa95c9fa 100644 --- a/idea/tests/org/jetbrains/jet/plugin/intentions/CodeTransformationTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/plugin/intentions/CodeTransformationTestGenerated.java @@ -30,2676 +30,53 @@ import org.jetbrains.jet.plugin.intentions.AbstractCodeTransformationTest; /** This class is generated by {@link org.jetbrains.jet.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") -@InnerTestClasses({CodeTransformationTestGenerated.DoubleBangToIfThen.class, CodeTransformationTestGenerated.IfThenToDoubleBang.class, 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.ConvertMemberToExtension.class, CodeTransformationTestGenerated.ReconstructedType.class, CodeTransformationTestGenerated.RemoveUnnecessaryParentheses.class, CodeTransformationTestGenerated.ReplaceWithDotQualifiedMethodCall.class, CodeTransformationTestGenerated.ReplaceWithInfixFunctionCall.class, CodeTransformationTestGenerated.RemoveCurlyBracesFromTemplate.class, CodeTransformationTestGenerated.ConvertToStringTemplateIntention.class, CodeTransformationTestGenerated.ConvertToConcatenatedStringIntention.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, CodeTransformationTestGenerated.SplitIf.class, CodeTransformationTestGenerated.ReplaceWithOperatorAssign.class, CodeTransformationTestGenerated.ReplaceWithTraditionalAssignment.class, CodeTransformationTestGenerated.SimplifyBooleanWithConstants.class, CodeTransformationTestGenerated.InsertExplicitTypeArguments.class, CodeTransformationTestGenerated.RemoveExplicitTypeArguments.class, CodeTransformationTestGenerated.ConvertAssertToIf.class, CodeTransformationTestGenerated.ConvertIfToAssert.class, CodeTransformationTestGenerated.MakeTypeExplicitInLambda.class, CodeTransformationTestGenerated.MakeTypeImplicitInLambda.class, CodeTransformationTestGenerated.InvertIfCondition.class, CodeTransformationTestGenerated.OperatorToFunction.class, CodeTransformationTestGenerated.ConvertToForEachLoop.class, CodeTransformationTestGenerated.ConvertToForEachFunctionCall.class}) +@TestMetadata("idea/testData/intentions") +@InnerTestClasses({CodeTransformationTestGenerated.AddBraces.class, CodeTransformationTestGenerated.AttributeCallReplacements.class, CodeTransformationTestGenerated.Branched.class, CodeTransformationTestGenerated.ConvertAssertToIf.class, CodeTransformationTestGenerated.ConvertIfToAssert.class, CodeTransformationTestGenerated.ConvertNegatedBooleanSequence.class, CodeTransformationTestGenerated.ConvertNegatedExpressionWithDemorgansLaw.class, CodeTransformationTestGenerated.ConvertToBlockBody.class, CodeTransformationTestGenerated.ConvertToConcatenatedStringIntention.class, CodeTransformationTestGenerated.ConvertToExpressionBody.class, CodeTransformationTestGenerated.ConvertToForEachFunctionCall.class, CodeTransformationTestGenerated.ConvertToForEachLoop.class, CodeTransformationTestGenerated.ConvertToStringTemplateIntention.class, CodeTransformationTestGenerated.Declarations.class, CodeTransformationTestGenerated.InsertCurlyBracesToTemplate.class, CodeTransformationTestGenerated.InsertExplicitTypeArguments.class, CodeTransformationTestGenerated.InvertIfCondition.class, CodeTransformationTestGenerated.MakeTypeExplicitInLambda.class, CodeTransformationTestGenerated.MakeTypeImplicitInLambda.class, CodeTransformationTestGenerated.MoveLambdaInsideParentheses.class, CodeTransformationTestGenerated.MoveLambdaOutsideParentheses.class, CodeTransformationTestGenerated.OperatorToFunction.class, CodeTransformationTestGenerated.ReconstructedType.class, CodeTransformationTestGenerated.RemoveBraces.class, CodeTransformationTestGenerated.RemoveCurlyBracesFromTemplate.class, CodeTransformationTestGenerated.RemoveExplicitTypeArguments.class, CodeTransformationTestGenerated.RemoveUnnecessaryParentheses.class, CodeTransformationTestGenerated.ReplaceExplicitFunctionLiteralParamWithIt.class, CodeTransformationTestGenerated.ReplaceItWithExplicitFunctionLiteralParam.class, CodeTransformationTestGenerated.ReplaceWithDotQualifiedMethodCall.class, CodeTransformationTestGenerated.ReplaceWithInfixFunctionCall.class, CodeTransformationTestGenerated.ReplaceWithOperatorAssign.class, CodeTransformationTestGenerated.ReplaceWithTraditionalAssignment.class, CodeTransformationTestGenerated.SimplifyBooleanWithConstants.class, CodeTransformationTestGenerated.SimplifyNegatedBinaryExpressionIntention.class, CodeTransformationTestGenerated.SpecifyType.class, CodeTransformationTestGenerated.SplitIf.class, CodeTransformationTestGenerated.SwapBinaryExpression.class}) public class CodeTransformationTestGenerated extends AbstractCodeTransformationTest { - @TestMetadata("idea/testData/intentions/branched/doubleBangToIfThen") - public static class DoubleBangToIfThen extends AbstractCodeTransformationTest { - public void testAllFilesPresentInDoubleBangToIfThen() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/doubleBangToIfThen"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("callExpression.kt") - public void testCallExpression() throws Exception { - doTestDoubleBangToIfThen("idea/testData/intentions/branched/doubleBangToIfThen/callExpression.kt"); - } - - @TestMetadata("callExpressionParens.kt") - public void testCallExpressionParens() throws Exception { - doTestDoubleBangToIfThen("idea/testData/intentions/branched/doubleBangToIfThen/callExpressionParens.kt"); - } - - @TestMetadata("exceptionTextEscapesQuotes.kt") - public void testExceptionTextEscapesQuotes() throws Exception { - doTestDoubleBangToIfThen("idea/testData/intentions/branched/doubleBangToIfThen/exceptionTextEscapesQuotes.kt"); - } - - @TestMetadata("exceptionTextHandlesMultiline.kt") - public void testExceptionTextHandlesMultiline() throws Exception { - doTestDoubleBangToIfThen("idea/testData/intentions/branched/doubleBangToIfThen/exceptionTextHandlesMultiline.kt"); - } - - @TestMetadata("localVal.kt") - public void testLocalVal() throws Exception { - doTestDoubleBangToIfThen("idea/testData/intentions/branched/doubleBangToIfThen/localVal.kt"); - } - - @TestMetadata("localVar.kt") - public void testLocalVar() throws Exception { - doTestDoubleBangToIfThen("idea/testData/intentions/branched/doubleBangToIfThen/localVar.kt"); - } - - @TestMetadata("simpleNameExpressionInParens.kt") - public void testSimpleNameExpressionInParens() throws Exception { - doTestDoubleBangToIfThen("idea/testData/intentions/branched/doubleBangToIfThen/simpleNameExpressionInParens.kt"); - } - - @TestMetadata("topLevelVal.kt") - public void testTopLevelVal() throws Exception { - doTestDoubleBangToIfThen("idea/testData/intentions/branched/doubleBangToIfThen/topLevelVal.kt"); - } - - @TestMetadata("topLevelValCustomGetter.kt") - public void testTopLevelValCustomGetter() throws Exception { - doTestDoubleBangToIfThen("idea/testData/intentions/branched/doubleBangToIfThen/topLevelValCustomGetter.kt"); - } - - @TestMetadata("topLevelVar.kt") - public void testTopLevelVar() throws Exception { - doTestDoubleBangToIfThen("idea/testData/intentions/branched/doubleBangToIfThen/topLevelVar.kt"); - } - - @TestMetadata("topLevelVarCustomGetter.kt") - public void testTopLevelVarCustomGetter() throws Exception { - doTestDoubleBangToIfThen("idea/testData/intentions/branched/doubleBangToIfThen/topLevelVarCustomGetter.kt"); - } - - @TestMetadata("usedInAssignment.kt") - public void testUsedInAssignment() throws Exception { - doTestDoubleBangToIfThen("idea/testData/intentions/branched/doubleBangToIfThen/usedInAssignment.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/branched/ifThenToDoubleBang") - public static class IfThenToDoubleBang extends AbstractCodeTransformationTest { - @TestMetadata("acceptableEmptyElseBlockForStatement.kt") - public void testAcceptableEmptyElseBlockForStatement() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/acceptableEmptyElseBlockForStatement.kt"); - } - - @TestMetadata("acceptableEmptyThenBlockForStatement.kt") - public void testAcceptableEmptyThenBlockForStatement() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/acceptableEmptyThenBlockForStatement.kt"); - } - - @TestMetadata("acceptableWithoutElseBlockForStatementWithFun.kt") - public void testAcceptableWithoutElseBlockForStatementWithFun() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/acceptableWithoutElseBlockForStatementWithFun.kt"); - } - - @TestMetadata("acceptableWithoutElseBlockForStatementWithVal.kt") - public void testAcceptableWithoutElseBlockForStatementWithVal() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/acceptableWithoutElseBlockForStatementWithVal.kt"); - } - - public void testAllFilesPresentInIfThenToDoubleBang() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/ifThenToDoubleBang"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("blockHasMoreThanOneStatement.kt") - public void testBlockHasMoreThanOneStatement() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/blockHasMoreThanOneStatement.kt"); - } - - @TestMetadata("blockUsesDifferentVar.kt") - public void testBlockUsesDifferentVar() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/blockUsesDifferentVar.kt"); - } - - @TestMetadata("conditionComparesNullWithNull.kt") - public void testConditionComparesNullWithNull() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/conditionComparesNullWithNull.kt"); - } - - @TestMetadata("conditionInvalidBinaryExp.kt") - public void testConditionInvalidBinaryExp() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/conditionInvalidBinaryExp.kt"); - } - - @TestMetadata("conditionNotBinaryExpr.kt") - public void testConditionNotBinaryExpr() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/conditionNotBinaryExpr.kt"); - } - - @TestMetadata("doesNotinlineValueIfUsedMoreThanOnce.kt") - public void testDoesNotinlineValueIfUsedMoreThanOnce() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/doesNotinlineValueIfUsedMoreThanOnce.kt"); - } - - @TestMetadata("doesNotinlineValueOutsideOfScope.kt") - public void testDoesNotinlineValueOutsideOfScope() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/doesNotinlineValueOutsideOfScope.kt"); - } - - @TestMetadata("emptyCondition.kt") - public void testEmptyCondition() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/emptyCondition.kt"); - } - - @TestMetadata("emptyElseBlock.kt") - public void testEmptyElseBlock() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/emptyElseBlock.kt"); - } - - @TestMetadata("emptyThenBlock.kt") - public void testEmptyThenBlock() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/emptyThenBlock.kt"); - } - - @TestMetadata("ifAndElseBothInBlocks.kt") - public void testIfAndElseBothInBlocks() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/ifAndElseBothInBlocks.kt"); - } - - @TestMetadata("ifAndElseNotInBlocks.kt") - public void testIfAndElseNotInBlocks() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/ifAndElseNotInBlocks.kt"); - } - - @TestMetadata("ifAsExpression.kt") - public void testIfAsExpression() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/ifAsExpression.kt"); - } - - @TestMetadata("lhsEqualsNull.kt") - public void testLhsEqualsNull() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/lhsEqualsNull.kt"); - } - - @TestMetadata("lhsNotEqualsNull.kt") - public void testLhsNotEqualsNull() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/lhsNotEqualsNull.kt"); - } - - @TestMetadata("missingElseClause.kt") - public void testMissingElseClause() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/missingElseClause.kt"); - } - - @TestMetadata("missingThenClause.kt") - public void testMissingThenClause() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/missingThenClause.kt"); - } - - @TestMetadata("noCondition.kt") - public void testNoCondition() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/noCondition.kt"); - } - - @TestMetadata("noNullInCondition.kt") - public void testNoNullInCondition() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/noNullInCondition.kt"); - } - - @TestMetadata("notApplicableForFunction.kt") - public void testNotApplicableForFunction() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/notApplicableForFunction.kt"); - } - - @TestMetadata("notApplicableForLocalVar.kt") - public void testNotApplicableForLocalVar() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/notApplicableForLocalVar.kt"); - } - - @TestMetadata("nullBranchAlsoNull.kt") - public void testNullBranchAlsoNull() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/nullBranchAlsoNull.kt"); - } - - @TestMetadata("otherBlockHasMoreThanOneStatement.kt") - public void testOtherBlockHasMoreThanOneStatement() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/otherBlockHasMoreThanOneStatement.kt"); - } - - @TestMetadata("rhsEqualsNull.kt") - public void testRhsEqualsNull() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/rhsEqualsNull.kt"); - } - - @TestMetadata("rhsNotEqualsNull.kt") - public void testRhsNotEqualsNull() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/rhsNotEqualsNull.kt"); - } - - @TestMetadata("thenAndElseBothNull.kt") - public void testThenAndElseBothNull() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/thenAndElseBothNull.kt"); - } - - @TestMetadata("throwByFqName.kt") - public void testThrowByFqName() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/throwByFqName.kt"); - } - - @TestMetadata("unacceptableEmptyElseBlockForExpression.kt") - public void testUnacceptableEmptyElseBlockForExpression() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/unacceptableEmptyElseBlockForExpression.kt"); - } - - @TestMetadata("unacceptableEmptyThenBlockForExpression.kt") - public void testUnacceptableEmptyThenBlockForExpression() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/unacceptableEmptyThenBlockForExpression.kt"); - } - - @TestMetadata("willNotInlineClassProperty.kt") - public void testWillNotInlineClassProperty() throws Exception { - doTestIfThenToDoubleBang("idea/testData/intentions/branched/ifThenToDoubleBang/willNotInlineClassProperty.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/branched/elvisToIfThen") - public static class ElvisToIfThen extends AbstractCodeTransformationTest { - public void testAllFilesPresentInElvisToIfThen() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/elvisToIfThen"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("callExpression.kt") - public void testCallExpression() throws Exception { - doTestElvisToIfThen("idea/testData/intentions/branched/elvisToIfThen/callExpression.kt"); - } - - @TestMetadata("callExpressionParens.kt") - public void testCallExpressionParens() throws Exception { - doTestElvisToIfThen("idea/testData/intentions/branched/elvisToIfThen/callExpressionParens.kt"); - } - - @TestMetadata("elvisAsExpression.kt") - public void testElvisAsExpression() throws Exception { - doTestElvisToIfThen("idea/testData/intentions/branched/elvisToIfThen/elvisAsExpression.kt"); - } - - @TestMetadata("localValLhs.kt") - public void testLocalValLhs() throws Exception { - doTestElvisToIfThen("idea/testData/intentions/branched/elvisToIfThen/localValLhs.kt"); - } - - @TestMetadata("localVarLhs.kt") - public void testLocalVarLhs() throws Exception { - doTestElvisToIfThen("idea/testData/intentions/branched/elvisToIfThen/localVarLhs.kt"); - } - - @TestMetadata("simpleNameExpression.kt") - public void testSimpleNameExpression() throws Exception { - doTestElvisToIfThen("idea/testData/intentions/branched/elvisToIfThen/simpleNameExpression.kt"); - } - - @TestMetadata("simpleNameExpressionInParens.kt") - public void testSimpleNameExpressionInParens() throws Exception { - doTestElvisToIfThen("idea/testData/intentions/branched/elvisToIfThen/simpleNameExpressionInParens.kt"); - } - - @TestMetadata("topLevelVal.kt") - public void testTopLevelVal() throws Exception { - doTestElvisToIfThen("idea/testData/intentions/branched/elvisToIfThen/topLevelVal.kt"); - } - - @TestMetadata("topLevelValCustomGetter.kt") - public void testTopLevelValCustomGetter() throws Exception { - doTestElvisToIfThen("idea/testData/intentions/branched/elvisToIfThen/topLevelValCustomGetter.kt"); - } - - @TestMetadata("topLevelVar.kt") - public void testTopLevelVar() throws Exception { - doTestElvisToIfThen("idea/testData/intentions/branched/elvisToIfThen/topLevelVar.kt"); - } - - @TestMetadata("topLevelVarCustomGetter.kt") - public void testTopLevelVarCustomGetter() throws Exception { - doTestElvisToIfThen("idea/testData/intentions/branched/elvisToIfThen/topLevelVarCustomGetter.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/branched/ifThenToElvis") - @InnerTestClasses({}) - public static class IfThenToElvis extends AbstractCodeTransformationTest { - public void testAllFilesPresentInIfThenToElvis() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/ifThenToElvis"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("blockHasMoreThanOneStatement.kt") - public void testBlockHasMoreThanOneStatement() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/blockHasMoreThanOneStatement.kt"); - } - - @TestMetadata("blockUsesDifferentVar.kt") - public void testBlockUsesDifferentVar() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/blockUsesDifferentVar.kt"); - } - - @TestMetadata("conditionComparesNullWithNull.kt") - public void testConditionComparesNullWithNull() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/conditionComparesNullWithNull.kt"); - } - - @TestMetadata("conditionInvalidBinaryExp.kt") - public void testConditionInvalidBinaryExp() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/conditionInvalidBinaryExp.kt"); - } - - @TestMetadata("conditionNotBinaryExpr.kt") - public void testConditionNotBinaryExpr() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/conditionNotBinaryExpr.kt"); - } - - @TestMetadata("doesNotinlineValueIfUsedMoreThanOnce.kt") - public void testDoesNotinlineValueIfUsedMoreThanOnce() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/doesNotinlineValueIfUsedMoreThanOnce.kt"); - } - - @TestMetadata("doesNotinlineValueOutsideOfScope.kt") - public void testDoesNotinlineValueOutsideOfScope() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/doesNotinlineValueOutsideOfScope.kt"); - } - - @TestMetadata("emptyCondition.kt") - public void testEmptyCondition() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/emptyCondition.kt"); - } - - @TestMetadata("emptyElseBlock.kt") - public void testEmptyElseBlock() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/emptyElseBlock.kt"); - } - - @TestMetadata("emptyThenBlock.kt") - public void testEmptyThenBlock() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/emptyThenBlock.kt"); - } - - @TestMetadata("ifAndElseBothInBlocks.kt") - public void testIfAndElseBothInBlocks() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/ifAndElseBothInBlocks.kt"); - } - - @TestMetadata("ifAndElseNotInBlocks.kt") - public void testIfAndElseNotInBlocks() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/ifAndElseNotInBlocks.kt"); - } - - @TestMetadata("ifAsExpression.kt") - public void testIfAsExpression() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/ifAsExpression.kt"); - } - - @TestMetadata("ifAsPartOfExpression.kt") - public void testIfAsPartOfExpression() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/ifAsPartOfExpression.kt"); - } - - @TestMetadata("lhsEqualsNull.kt") - public void testLhsEqualsNull() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/lhsEqualsNull.kt"); - } - - @TestMetadata("lhsNotEqualsNull.kt") - public void testLhsNotEqualsNull() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/lhsNotEqualsNull.kt"); - } - - @TestMetadata("missingElseClause.kt") - public void testMissingElseClause() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/missingElseClause.kt"); - } - - @TestMetadata("missingThenClause.kt") - public void testMissingThenClause() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/missingThenClause.kt"); - } - - @TestMetadata("noCondition.kt") - public void testNoCondition() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/noCondition.kt"); - } - - @TestMetadata("noNullInCondition.kt") - public void testNoNullInCondition() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/noNullInCondition.kt"); - } - - @TestMetadata("notApplicableForFunction.kt") - public void testNotApplicableForFunction() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/notApplicableForFunction.kt"); - } - - @TestMetadata("notApplicableForLocalVar.kt") - public void testNotApplicableForLocalVar() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/notApplicableForLocalVar.kt"); - } - - @TestMetadata("notApplicableForSimpleKotlinNPE.kt") - public void testNotApplicableForSimpleKotlinNPE() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/notApplicableForSimpleKotlinNPE.kt"); - } - - @TestMetadata("notApplicableForSimpleNPE.kt") - public void testNotApplicableForSimpleNPE() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/notApplicableForSimpleNPE.kt"); - } - - @TestMetadata("nullBranchAlsoNull.kt") - public void testNullBranchAlsoNull() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/nullBranchAlsoNull.kt"); - } - - @TestMetadata("otherBlockHasMoreThanOneStatement.kt") - public void testOtherBlockHasMoreThanOneStatement() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/otherBlockHasMoreThanOneStatement.kt"); - } - - @TestMetadata("rhsEqualsNull.kt") - public void testRhsEqualsNull() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/rhsEqualsNull.kt"); - } - - @TestMetadata("rhsNotEqualsNull.kt") - public void testRhsNotEqualsNull() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/rhsNotEqualsNull.kt"); - } - - @TestMetadata("thenAndElseBothNull.kt") - public void testThenAndElseBothNull() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/thenAndElseBothNull.kt"); - } - - @TestMetadata("throwsNPEwithArgument.kt") - public void testThrowsNPEwithArgument() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/throwsNPEwithArgument.kt"); - } - - @TestMetadata("willNotInlineClassProperty.kt") - public void testWillNotInlineClassProperty() throws Exception { - doTestIfThenToElvis("idea/testData/intentions/branched/ifThenToElvis/willNotInlineClassProperty.kt"); - } - - public static Test innerSuite() { - TestSuite suite = new TestSuite("IfThenToElvis"); - suite.addTestSuite(IfThenToElvis.class); - return suite; - } - } - - @TestMetadata("idea/testData/intentions/branched/safeAccessToIfThen") - public static class SafeAccessToIfThen extends AbstractCodeTransformationTest { - public void testAllFilesPresentInSafeAccessToIfThen() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/safeAccessToIfThen"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("binaryExpressionLhs.kt") - public void testBinaryExpressionLhs() throws Exception { - doTestSafeAccessToIfThen("idea/testData/intentions/branched/safeAccessToIfThen/binaryExpressionLhs.kt"); - } - - @TestMetadata("callExpression.kt") - public void testCallExpression() throws Exception { - doTestSafeAccessToIfThen("idea/testData/intentions/branched/safeAccessToIfThen/callExpression.kt"); - } - - @TestMetadata("callExpressionParens.kt") - public void testCallExpressionParens() throws Exception { - doTestSafeAccessToIfThen("idea/testData/intentions/branched/safeAccessToIfThen/callExpressionParens.kt"); - } - - @TestMetadata("customGetterAsReceiver.kt") - public void testCustomGetterAsReceiver() throws Exception { - doTestSafeAccessToIfThen("idea/testData/intentions/branched/safeAccessToIfThen/customGetterAsReceiver.kt"); - } - - @TestMetadata("localValAsReceiver.kt") - public void testLocalValAsReceiver() throws Exception { - doTestSafeAccessToIfThen("idea/testData/intentions/branched/safeAccessToIfThen/localValAsReceiver.kt"); - } - - @TestMetadata("localValLhs.kt") - public void testLocalValLhs() throws Exception { - doTestSafeAccessToIfThen("idea/testData/intentions/branched/safeAccessToIfThen/localValLhs.kt"); - } - - @TestMetadata("localVarLhs.kt") - public void testLocalVarLhs() throws Exception { - doTestSafeAccessToIfThen("idea/testData/intentions/branched/safeAccessToIfThen/localVarLhs.kt"); - } - - @TestMetadata("resultAssignedToLocalVal.kt") - public void testResultAssignedToLocalVal() throws Exception { - doTestSafeAccessToIfThen("idea/testData/intentions/branched/safeAccessToIfThen/resultAssignedToLocalVal.kt"); - } - - @TestMetadata("safeAccessAsFunctionArgument.kt") - public void testSafeAccessAsFunctionArgument() throws Exception { - doTestSafeAccessToIfThen("idea/testData/intentions/branched/safeAccessToIfThen/safeAccessAsFunctionArgument.kt"); - } - - @TestMetadata("simpleNameExpression.kt") - public void testSimpleNameExpression() throws Exception { - doTestSafeAccessToIfThen("idea/testData/intentions/branched/safeAccessToIfThen/simpleNameExpression.kt"); - } - - @TestMetadata("simpleNameExpressionInParens.kt") - public void testSimpleNameExpressionInParens() throws Exception { - doTestSafeAccessToIfThen("idea/testData/intentions/branched/safeAccessToIfThen/simpleNameExpressionInParens.kt"); - } - - @TestMetadata("simplePropertyAsReceiver.kt") - public void testSimplePropertyAsReceiver() throws Exception { - doTestSafeAccessToIfThen("idea/testData/intentions/branched/safeAccessToIfThen/simplePropertyAsReceiver.kt"); - } - - @TestMetadata("simplePropertyAsReceiver2.kt") - public void testSimplePropertyAsReceiver2() throws Exception { - doTestSafeAccessToIfThen("idea/testData/intentions/branched/safeAccessToIfThen/simplePropertyAsReceiver2.kt"); - } - - @TestMetadata("simplePropertyAsReceiver3.kt") - public void testSimplePropertyAsReceiver3() throws Exception { - doTestSafeAccessToIfThen("idea/testData/intentions/branched/safeAccessToIfThen/simplePropertyAsReceiver3.kt"); - } - - @TestMetadata("topLevelVal.kt") - public void testTopLevelVal() throws Exception { - doTestSafeAccessToIfThen("idea/testData/intentions/branched/safeAccessToIfThen/topLevelVal.kt"); - } - - @TestMetadata("topLevelValCustomGetter.kt") - public void testTopLevelValCustomGetter() throws Exception { - doTestSafeAccessToIfThen("idea/testData/intentions/branched/safeAccessToIfThen/topLevelValCustomGetter.kt"); - } - - @TestMetadata("topLevelVar.kt") - public void testTopLevelVar() throws Exception { - doTestSafeAccessToIfThen("idea/testData/intentions/branched/safeAccessToIfThen/topLevelVar.kt"); - } - - @TestMetadata("topLevelVarCustomGetter.kt") - public void testTopLevelVarCustomGetter() throws Exception { - doTestSafeAccessToIfThen("idea/testData/intentions/branched/safeAccessToIfThen/topLevelVarCustomGetter.kt"); - } - - @TestMetadata("usedAsFunctionRhs.kt") - public void testUsedAsFunctionRhs() throws Exception { - doTestSafeAccessToIfThen("idea/testData/intentions/branched/safeAccessToIfThen/usedAsFunctionRhs.kt"); - } - - @TestMetadata("usedAsResultOfCheckedIf.kt") - public void testUsedAsResultOfCheckedIf() throws Exception { - doTestSafeAccessToIfThen("idea/testData/intentions/branched/safeAccessToIfThen/usedAsResultOfCheckedIf.kt"); - } - - @TestMetadata("usedAsReturnValue.kt") - public void testUsedAsReturnValue() throws Exception { - doTestSafeAccessToIfThen("idea/testData/intentions/branched/safeAccessToIfThen/usedAsReturnValue.kt"); - } - - @TestMetadata("usedInUncheckedIfExpression.kt") - public void testUsedInUncheckedIfExpression() throws Exception { - doTestSafeAccessToIfThen("idea/testData/intentions/branched/safeAccessToIfThen/usedInUncheckedIfExpression.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/branched/ifThenToSafeAccess") - @InnerTestClasses({}) - public static class IfThenToSafeAccess extends AbstractCodeTransformationTest { - public void testAllFilesPresentInIfThenToSafeAccess() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/ifThenToSafeAccess"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("blockHasMoreThanOneStatement.kt") - public void testBlockHasMoreThanOneStatement() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/blockHasMoreThanOneStatement.kt"); - } - - @TestMetadata("blockUsesDifferentVar.kt") - public void testBlockUsesDifferentVar() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/blockUsesDifferentVar.kt"); - } - - @TestMetadata("conditionComparesNullWithNull.kt") - public void testConditionComparesNullWithNull() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/conditionComparesNullWithNull.kt"); - } - - @TestMetadata("conditionInvalidBinaryExp.kt") - public void testConditionInvalidBinaryExp() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/conditionInvalidBinaryExp.kt"); - } - - @TestMetadata("conditionNotBinaryExpr.kt") - public void testConditionNotBinaryExpr() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/conditionNotBinaryExpr.kt"); - } - - @TestMetadata("doesNotinlineValueIfUsedMoreThanOnce.kt") - public void testDoesNotinlineValueIfUsedMoreThanOnce() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/doesNotinlineValueIfUsedMoreThanOnce.kt"); - } - - @TestMetadata("doesNotinlineValueOutsideOfScope.kt") - public void testDoesNotinlineValueOutsideOfScope() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/doesNotinlineValueOutsideOfScope.kt"); - } - - @TestMetadata("emptyCondition.kt") - public void testEmptyCondition() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/emptyCondition.kt"); - } - - @TestMetadata("emptyElseBlock.kt") - public void testEmptyElseBlock() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/emptyElseBlock.kt"); - } - - @TestMetadata("emptyThenBlock.kt") - public void testEmptyThenBlock() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/emptyThenBlock.kt"); - } - - @TestMetadata("ifAndElseBothInBlocks.kt") - public void testIfAndElseBothInBlocks() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/ifAndElseBothInBlocks.kt"); - } - - @TestMetadata("ifAndElseNotInBlocks.kt") - public void testIfAndElseNotInBlocks() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/ifAndElseNotInBlocks.kt"); - } - - @TestMetadata("ifAsExpression.kt") - public void testIfAsExpression() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/ifAsExpression.kt"); - } - - @TestMetadata("lhsEqualsNull.kt") - public void testLhsEqualsNull() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/lhsEqualsNull.kt"); - } - - @TestMetadata("lhsNotEqualsNull.kt") - public void testLhsNotEqualsNull() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/lhsNotEqualsNull.kt"); - } - - @TestMetadata("missingNecessaryElseClause.kt") - public void testMissingNecessaryElseClause() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/missingNecessaryElseClause.kt"); - } - - @TestMetadata("missingNecessaryThenClause.kt") - public void testMissingNecessaryThenClause() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/missingNecessaryThenClause.kt"); - } - - @TestMetadata("noCondition.kt") - public void testNoCondition() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/noCondition.kt"); - } - - @TestMetadata("noElseBlock.kt") - public void testNoElseBlock() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/noElseBlock.kt"); - } - - @TestMetadata("noNullInCondition.kt") - public void testNoNullInCondition() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/noNullInCondition.kt"); - } - - @TestMetadata("noNullInCondition2.kt") - public void testNoNullInCondition2() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/noNullInCondition2.kt"); - } - - @TestMetadata("noThenBlock.kt") - public void testNoThenBlock() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/noThenBlock.kt"); - } - - @TestMetadata("notApplicableForFunction.kt") - public void testNotApplicableForFunction() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/notApplicableForFunction.kt"); - } - - @TestMetadata("notApplicableForLocalVar.kt") - public void testNotApplicableForLocalVar() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/notApplicableForLocalVar.kt"); - } - - @TestMetadata("otherBlockHasMoreThanOneStatement.kt") - public void testOtherBlockHasMoreThanOneStatement() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/otherBlockHasMoreThanOneStatement.kt"); - } - - @TestMetadata("rhsEqualsNull.kt") - public void testRhsEqualsNull() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/rhsEqualsNull.kt"); - } - - @TestMetadata("rhsNotEqualsNull.kt") - public void testRhsNotEqualsNull() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/rhsNotEqualsNull.kt"); - } - - @TestMetadata("thenAndElseBothNull.kt") - public void testThenAndElseBothNull() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/thenAndElseBothNull.kt"); - } - - @TestMetadata("thenAndElseNotNull.kt") - public void testThenAndElseNotNull() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/thenAndElseNotNull.kt"); - } - - @TestMetadata("unacceptableEmptyElseBlock.kt") - public void testUnacceptableEmptyElseBlock() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/unacceptableEmptyElseBlock.kt"); - } - - @TestMetadata("unacceptableEmptyThenBlock.kt") - public void testUnacceptableEmptyThenBlock() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/unacceptableEmptyThenBlock.kt"); - } - - @TestMetadata("unacceptableNoElseBlock.kt") - public void testUnacceptableNoElseBlock() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/unacceptableNoElseBlock.kt"); - } - - @TestMetadata("unacceptableNoThenBlock.kt") - public void testUnacceptableNoThenBlock() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/unacceptableNoThenBlock.kt"); - } - - @TestMetadata("willNotInlineClassProperty.kt") - public void testWillNotInlineClassProperty() throws Exception { - doTestIfThenToSafeAccess("idea/testData/intentions/branched/ifThenToSafeAccess/willNotInlineClassProperty.kt"); - } - - public static Test innerSuite() { - TestSuite suite = new TestSuite("IfThenToSafeAccess"); - suite.addTestSuite(IfThenToSafeAccess.class); - return suite; - } - } - - @TestMetadata("idea/testData/intentions/branched/folding/ifToAssignment") - public static class IfToAssignment extends AbstractCodeTransformationTest { - public void testAllFilesPresentInIfToAssignment() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/folding/ifToAssignment"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("innerIfTransformed.kt") - public void testInnerIfTransformed() throws Exception { - doTestFoldIfToAssignment("idea/testData/intentions/branched/folding/ifToAssignment/innerIfTransformed.kt"); - } - - @TestMetadata("simpleIf.kt") - public void testSimpleIf() throws Exception { - doTestFoldIfToAssignment("idea/testData/intentions/branched/folding/ifToAssignment/simpleIf.kt"); - } - - @TestMetadata("simpleIfWithAugmentedAssignment.kt") - public void testSimpleIfWithAugmentedAssignment() throws Exception { - doTestFoldIfToAssignment("idea/testData/intentions/branched/folding/ifToAssignment/simpleIfWithAugmentedAssignment.kt"); - } - - @TestMetadata("simpleIfWithBlocks.kt") - public void testSimpleIfWithBlocks() throws Exception { - doTestFoldIfToAssignment("idea/testData/intentions/branched/folding/ifToAssignment/simpleIfWithBlocks.kt"); - } - - @TestMetadata("simpleIfWithShadowedVar.kt") - public void testSimpleIfWithShadowedVar() throws Exception { - doTestFoldIfToAssignment("idea/testData/intentions/branched/folding/ifToAssignment/simpleIfWithShadowedVar.kt"); - } - - @TestMetadata("simpleIfWithUnmatchedAssignmentOps.kt") - public void testSimpleIfWithUnmatchedAssignmentOps() throws Exception { - doTestFoldIfToAssignment("idea/testData/intentions/branched/folding/ifToAssignment/simpleIfWithUnmatchedAssignmentOps.kt"); - } - - @TestMetadata("simpleIfWithUnmatchedAssignments.kt") - public void testSimpleIfWithUnmatchedAssignments() throws Exception { - doTestFoldIfToAssignment("idea/testData/intentions/branched/folding/ifToAssignment/simpleIfWithUnmatchedAssignments.kt"); - } - - @TestMetadata("simpleIfWithoutElse.kt") - public void testSimpleIfWithoutElse() throws Exception { - doTestFoldIfToAssignment("idea/testData/intentions/branched/folding/ifToAssignment/simpleIfWithoutElse.kt"); - } - - @TestMetadata("simpleIfWithoutTerminatingAssignment.kt") - public void testSimpleIfWithoutTerminatingAssignment() throws Exception { - doTestFoldIfToAssignment("idea/testData/intentions/branched/folding/ifToAssignment/simpleIfWithoutTerminatingAssignment.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/branched/folding/ifToReturn") - public static class IfToReturn extends AbstractCodeTransformationTest { - public void testAllFilesPresentInIfToReturn() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/folding/ifToReturn"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("innerIfTransformed.kt") - public void testInnerIfTransformed() throws Exception { - doTestFoldIfToReturn("idea/testData/intentions/branched/folding/ifToReturn/innerIfTransformed.kt"); - } - - @TestMetadata("simpleIf.kt") - public void testSimpleIf() throws Exception { - doTestFoldIfToReturn("idea/testData/intentions/branched/folding/ifToReturn/simpleIf.kt"); - } - - @TestMetadata("simpleIfWithBlocks.kt") - public void testSimpleIfWithBlocks() throws Exception { - doTestFoldIfToReturn("idea/testData/intentions/branched/folding/ifToReturn/simpleIfWithBlocks.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/branched/folding/ifToReturnAsymmetrically") - public static class IfToReturnAsymmetrically extends AbstractCodeTransformationTest { - public void testAllFilesPresentInIfToReturnAsymmetrically() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/folding/ifToReturnAsymmetrically"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("simpleIf.kt") - public void testSimpleIf() throws Exception { - doTestFoldIfToReturnAsymmetrically("idea/testData/intentions/branched/folding/ifToReturnAsymmetrically/simpleIf.kt"); - } - - @TestMetadata("simpleIfWithBlocks.kt") - public void testSimpleIfWithBlocks() throws Exception { - doTestFoldIfToReturnAsymmetrically("idea/testData/intentions/branched/folding/ifToReturnAsymmetrically/simpleIfWithBlocks.kt"); - } - - @TestMetadata("simpleIfWithComments.kt") - public void testSimpleIfWithComments() throws Exception { - doTestFoldIfToReturnAsymmetrically("idea/testData/intentions/branched/folding/ifToReturnAsymmetrically/simpleIfWithComments.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/branched/folding/whenToAssignment") - public static class WhenToAssignment extends AbstractCodeTransformationTest { - public void testAllFilesPresentInWhenToAssignment() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/folding/whenToAssignment"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("innerWhenTransformed.kt") - public void testInnerWhenTransformed() throws Exception { - doTestFoldWhenToAssignment("idea/testData/intentions/branched/folding/whenToAssignment/innerWhenTransformed.kt"); - } - - @TestMetadata("simpleWhen.kt") - public void testSimpleWhen() throws Exception { - doTestFoldWhenToAssignment("idea/testData/intentions/branched/folding/whenToAssignment/simpleWhen.kt"); - } - - @TestMetadata("simpleWhenWithBlocks.kt") - public void testSimpleWhenWithBlocks() throws Exception { - doTestFoldWhenToAssignment("idea/testData/intentions/branched/folding/whenToAssignment/simpleWhenWithBlocks.kt"); - } - - @TestMetadata("simpleWhenWithShadowedVar.kt") - public void testSimpleWhenWithShadowedVar() throws Exception { - doTestFoldWhenToAssignment("idea/testData/intentions/branched/folding/whenToAssignment/simpleWhenWithShadowedVar.kt"); - } - - @TestMetadata("simpleWhenWithUnmatchedAssignments.kt") - public void testSimpleWhenWithUnmatchedAssignments() throws Exception { - doTestFoldWhenToAssignment("idea/testData/intentions/branched/folding/whenToAssignment/simpleWhenWithUnmatchedAssignments.kt"); - } - - @TestMetadata("simpleWhenWithoutTerminatingAssignment.kt") - public void testSimpleWhenWithoutTerminatingAssignment() throws Exception { - doTestFoldWhenToAssignment("idea/testData/intentions/branched/folding/whenToAssignment/simpleWhenWithoutTerminatingAssignment.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/branched/folding/whenToReturn") - public static class WhenToReturn extends AbstractCodeTransformationTest { - public void testAllFilesPresentInWhenToReturn() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/folding/whenToReturn"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("innerWhenTransformed.kt") - public void testInnerWhenTransformed() throws Exception { - doTestFoldWhenToReturn("idea/testData/intentions/branched/folding/whenToReturn/innerWhenTransformed.kt"); - } - - @TestMetadata("simpleWhen.kt") - public void testSimpleWhen() throws Exception { - doTestFoldWhenToReturn("idea/testData/intentions/branched/folding/whenToReturn/simpleWhen.kt"); - } - - @TestMetadata("simpleWhenWithBlocks.kt") - public void testSimpleWhenWithBlocks() throws Exception { - doTestFoldWhenToReturn("idea/testData/intentions/branched/folding/whenToReturn/simpleWhenWithBlocks.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/branched/unfolding/assignmentToIf") - public static class AssignmentToIf extends AbstractCodeTransformationTest { - public void testAllFilesPresentInAssignmentToIf() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/unfolding/assignmentToIf"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("innerIfTransformed.kt") - public void testInnerIfTransformed() throws Exception { - doTestUnfoldAssignmentToIf("idea/testData/intentions/branched/unfolding/assignmentToIf/innerIfTransformed.kt"); - } - - @TestMetadata("nestedIfs.kt") - public void testNestedIfs() throws Exception { - doTestUnfoldAssignmentToIf("idea/testData/intentions/branched/unfolding/assignmentToIf/nestedIfs.kt"); - } - - @TestMetadata("simpleIf.kt") - public void testSimpleIf() throws Exception { - doTestUnfoldAssignmentToIf("idea/testData/intentions/branched/unfolding/assignmentToIf/simpleIf.kt"); - } - - @TestMetadata("simpleIfWithAugmentedAssignment.kt") - public void testSimpleIfWithAugmentedAssignment() throws Exception { - doTestUnfoldAssignmentToIf("idea/testData/intentions/branched/unfolding/assignmentToIf/simpleIfWithAugmentedAssignment.kt"); - } - - @TestMetadata("simpleIfWithBlocks.kt") - public void testSimpleIfWithBlocks() throws Exception { - doTestUnfoldAssignmentToIf("idea/testData/intentions/branched/unfolding/assignmentToIf/simpleIfWithBlocks.kt"); - } - - @TestMetadata("simpleIfWithComplexAssignmentLHS.kt") - public void testSimpleIfWithComplexAssignmentLHS() throws Exception { - doTestUnfoldAssignmentToIf("idea/testData/intentions/branched/unfolding/assignmentToIf/simpleIfWithComplexAssignmentLHS.kt"); - } - - @TestMetadata("simpleIfWithoutAssignment.kt") - public void testSimpleIfWithoutAssignment() throws Exception { - doTestUnfoldAssignmentToIf("idea/testData/intentions/branched/unfolding/assignmentToIf/simpleIfWithoutAssignment.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/branched/unfolding/assignmentToWhen") - public static class AssignmentToWhen extends AbstractCodeTransformationTest { - public void testAllFilesPresentInAssignmentToWhen() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/unfolding/assignmentToWhen"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("innerWhenTransformed.kt") - public void testInnerWhenTransformed() throws Exception { - doTestUnfoldAssignmentToWhen("idea/testData/intentions/branched/unfolding/assignmentToWhen/innerWhenTransformed.kt"); - } - - @TestMetadata("simpleWhen.kt") - public void testSimpleWhen() throws Exception { - doTestUnfoldAssignmentToWhen("idea/testData/intentions/branched/unfolding/assignmentToWhen/simpleWhen.kt"); - } - - @TestMetadata("simpleWhenWithBlocks.kt") - public void testSimpleWhenWithBlocks() throws Exception { - doTestUnfoldAssignmentToWhen("idea/testData/intentions/branched/unfolding/assignmentToWhen/simpleWhenWithBlocks.kt"); - } - - @TestMetadata("simpleWhenWithComplexAssignmentLHS.kt") - public void testSimpleWhenWithComplexAssignmentLHS() throws Exception { - doTestUnfoldAssignmentToWhen("idea/testData/intentions/branched/unfolding/assignmentToWhen/simpleWhenWithComplexAssignmentLHS.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/branched/unfolding/propertyToIf") - public static class PropertyToIf extends AbstractCodeTransformationTest { - public void testAllFilesPresentInPropertyToIf() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/unfolding/propertyToIf"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("nestedIfs.kt") - public void testNestedIfs() throws Exception { - doTestUnfoldPropertyToIf("idea/testData/intentions/branched/unfolding/propertyToIf/nestedIfs.kt"); - } - - @TestMetadata("nestedIfs2.kt") - public void testNestedIfs2() throws Exception { - doTestUnfoldPropertyToIf("idea/testData/intentions/branched/unfolding/propertyToIf/nestedIfs2.kt"); - } - - @TestMetadata("nonLocalProperty.kt") - public void testNonLocalProperty() throws Exception { - doTestUnfoldPropertyToIf("idea/testData/intentions/branched/unfolding/propertyToIf/nonLocalProperty.kt"); - } - - @TestMetadata("nonLocalProperty2.kt") - public void testNonLocalProperty2() throws Exception { - doTestUnfoldPropertyToIf("idea/testData/intentions/branched/unfolding/propertyToIf/nonLocalProperty2.kt"); - } - - @TestMetadata("simpleIf.kt") - public void testSimpleIf() throws Exception { - doTestUnfoldPropertyToIf("idea/testData/intentions/branched/unfolding/propertyToIf/simpleIf.kt"); - } - - @TestMetadata("simpleIf2.kt") - public void testSimpleIf2() throws Exception { - doTestUnfoldPropertyToIf("idea/testData/intentions/branched/unfolding/propertyToIf/simpleIf2.kt"); - } - - @TestMetadata("simpleIfWithBlocks.kt") - public void testSimpleIfWithBlocks() throws Exception { - doTestUnfoldPropertyToIf("idea/testData/intentions/branched/unfolding/propertyToIf/simpleIfWithBlocks.kt"); - } - - @TestMetadata("simpleIfWithBlocks2.kt") - public void testSimpleIfWithBlocks2() throws Exception { - doTestUnfoldPropertyToIf("idea/testData/intentions/branched/unfolding/propertyToIf/simpleIfWithBlocks2.kt"); - } - - @TestMetadata("simpleIfWithType.kt") - public void testSimpleIfWithType() throws Exception { - doTestUnfoldPropertyToIf("idea/testData/intentions/branched/unfolding/propertyToIf/simpleIfWithType.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/branched/unfolding/propertyToWhen") - public static class PropertyToWhen extends AbstractCodeTransformationTest { - public void testAllFilesPresentInPropertyToWhen() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/unfolding/propertyToWhen"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("nonLocalProperty.kt") - public void testNonLocalProperty() throws Exception { - doTestUnfoldPropertyToWhen("idea/testData/intentions/branched/unfolding/propertyToWhen/nonLocalProperty.kt"); - } - - @TestMetadata("nonLocalProperty2.kt") - public void testNonLocalProperty2() throws Exception { - doTestUnfoldPropertyToWhen("idea/testData/intentions/branched/unfolding/propertyToWhen/nonLocalProperty2.kt"); - } - - @TestMetadata("simpleWhen.kt") - public void testSimpleWhen() throws Exception { - doTestUnfoldPropertyToWhen("idea/testData/intentions/branched/unfolding/propertyToWhen/simpleWhen.kt"); - } - - @TestMetadata("simpleWhen2.kt") - public void testSimpleWhen2() throws Exception { - doTestUnfoldPropertyToWhen("idea/testData/intentions/branched/unfolding/propertyToWhen/simpleWhen2.kt"); - } - - @TestMetadata("simpleWhenWithBlocks.kt") - public void testSimpleWhenWithBlocks() throws Exception { - doTestUnfoldPropertyToWhen("idea/testData/intentions/branched/unfolding/propertyToWhen/simpleWhenWithBlocks.kt"); - } - - @TestMetadata("simpleWhenWithBlocks2.kt") - public void testSimpleWhenWithBlocks2() throws Exception { - doTestUnfoldPropertyToWhen("idea/testData/intentions/branched/unfolding/propertyToWhen/simpleWhenWithBlocks2.kt"); - } - - @TestMetadata("simpleWhenWithType.kt") - public void testSimpleWhenWithType() throws Exception { - doTestUnfoldPropertyToWhen("idea/testData/intentions/branched/unfolding/propertyToWhen/simpleWhenWithType.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/branched/unfolding/returnToIf") - public static class ReturnToIf extends AbstractCodeTransformationTest { - public void testAllFilesPresentInReturnToIf() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/unfolding/returnToIf"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("innerIfTransformed.kt") - public void testInnerIfTransformed() throws Exception { - doTestUnfoldReturnToIf("idea/testData/intentions/branched/unfolding/returnToIf/innerIfTransformed.kt"); - } - - @TestMetadata("simpleIf.kt") - public void testSimpleIf() throws Exception { - doTestUnfoldReturnToIf("idea/testData/intentions/branched/unfolding/returnToIf/simpleIf.kt"); - } - - @TestMetadata("simpleIfWithBlocks.kt") - public void testSimpleIfWithBlocks() throws Exception { - doTestUnfoldReturnToIf("idea/testData/intentions/branched/unfolding/returnToIf/simpleIfWithBlocks.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/branched/unfolding/returnToWhen") - public static class ReturnToWhen extends AbstractCodeTransformationTest { - public void testAllFilesPresentInReturnToWhen() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/unfolding/returnToWhen"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("innerWhenTransformed.kt") - public void testInnerWhenTransformed() throws Exception { - doTestUnfoldReturnToWhen("idea/testData/intentions/branched/unfolding/returnToWhen/innerWhenTransformed.kt"); - } - - @TestMetadata("simpleWhen.kt") - public void testSimpleWhen() throws Exception { - doTestUnfoldReturnToWhen("idea/testData/intentions/branched/unfolding/returnToWhen/simpleWhen.kt"); - } - - @TestMetadata("simpleWhenWithBlocks.kt") - public void testSimpleWhenWithBlocks() throws Exception { - doTestUnfoldReturnToWhen("idea/testData/intentions/branched/unfolding/returnToWhen/simpleWhenWithBlocks.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/branched/ifWhen/ifToWhen") - public static class IfToWhen extends AbstractCodeTransformationTest { - public void testAllFilesPresentInIfToWhen() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/ifWhen/ifToWhen"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("ifWithEqualityTests.kt") - public void testIfWithEqualityTests() throws Exception { - doTestIfToWhen("idea/testData/intentions/branched/ifWhen/ifToWhen/ifWithEqualityTests.kt"); - } - - @TestMetadata("ifWithIs.kt") - public void testIfWithIs() throws Exception { - doTestIfToWhen("idea/testData/intentions/branched/ifWhen/ifToWhen/ifWithIs.kt"); - } - - @TestMetadata("ifWithMultiConditions.kt") - public void testIfWithMultiConditions() throws Exception { - doTestIfToWhen("idea/testData/intentions/branched/ifWhen/ifToWhen/ifWithMultiConditions.kt"); - } - - @TestMetadata("ifWithNegativeIs.kt") - public void testIfWithNegativeIs() throws Exception { - doTestIfToWhen("idea/testData/intentions/branched/ifWhen/ifToWhen/ifWithNegativeIs.kt"); - } - - @TestMetadata("ifWithNegativeRangeTests.kt") - public void testIfWithNegativeRangeTests() throws Exception { - doTestIfToWhen("idea/testData/intentions/branched/ifWhen/ifToWhen/ifWithNegativeRangeTests.kt"); - } - - @TestMetadata("ifWithRangeTests.kt") - public void testIfWithRangeTests() throws Exception { - doTestIfToWhen("idea/testData/intentions/branched/ifWhen/ifToWhen/ifWithRangeTests.kt"); - } - - @TestMetadata("ifWithRangeTestsAndMultiConditions.kt") - public void testIfWithRangeTestsAndMultiConditions() throws Exception { - doTestIfToWhen("idea/testData/intentions/branched/ifWhen/ifToWhen/ifWithRangeTestsAndMultiConditions.kt"); - } - - @TestMetadata("ifWithRangeTestsAndUnparenthesizedMultiConditions.kt") - public void testIfWithRangeTestsAndUnparenthesizedMultiConditions() throws Exception { - doTestIfToWhen("idea/testData/intentions/branched/ifWhen/ifToWhen/ifWithRangeTestsAndUnparenthesizedMultiConditions.kt"); - } - - @TestMetadata("ifWithoutElse.kt") - public void testIfWithoutElse() throws Exception { - doTestIfToWhen("idea/testData/intentions/branched/ifWhen/ifToWhen/ifWithoutElse.kt"); - } - - @TestMetadata("whenWithMultipleConditionTypes.kt") - public void testWhenWithMultipleConditionTypes() throws Exception { - doTestIfToWhen("idea/testData/intentions/branched/ifWhen/ifToWhen/whenWithMultipleConditionTypes.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/branched/ifWhen/whenToIf") - public static class WhenToIf extends AbstractCodeTransformationTest { - public void testAllFilesPresentInWhenToIf() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/ifWhen/whenToIf"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("whenWithDotQualifiedExpression.kt") - public void testWhenWithDotQualifiedExpression() throws Exception { - doTestWhenToIf("idea/testData/intentions/branched/ifWhen/whenToIf/whenWithDotQualifiedExpression.kt"); - } - - @TestMetadata("whenWithEqualityTests.kt") - public void testWhenWithEqualityTests() throws Exception { - doTestWhenToIf("idea/testData/intentions/branched/ifWhen/whenToIf/whenWithEqualityTests.kt"); - } - - @TestMetadata("whenWithMultiConditions.kt") - public void testWhenWithMultiConditions() throws Exception { - doTestWhenToIf("idea/testData/intentions/branched/ifWhen/whenToIf/whenWithMultiConditions.kt"); - } - - @TestMetadata("whenWithMultipleConditionTypes.kt") - public void testWhenWithMultipleConditionTypes() throws Exception { - doTestWhenToIf("idea/testData/intentions/branched/ifWhen/whenToIf/whenWithMultipleConditionTypes.kt"); - } - - @TestMetadata("whenWithNegativePatterns.kt") - public void testWhenWithNegativePatterns() throws Exception { - doTestWhenToIf("idea/testData/intentions/branched/ifWhen/whenToIf/whenWithNegativePatterns.kt"); - } - - @TestMetadata("whenWithNegativeRangeTests.kt") - public void testWhenWithNegativeRangeTests() throws Exception { - doTestWhenToIf("idea/testData/intentions/branched/ifWhen/whenToIf/whenWithNegativeRangeTests.kt"); - } - - @TestMetadata("whenWithPatterns.kt") - public void testWhenWithPatterns() throws Exception { - doTestWhenToIf("idea/testData/intentions/branched/ifWhen/whenToIf/whenWithPatterns.kt"); - } - - @TestMetadata("whenWithRangeTests.kt") - public void testWhenWithRangeTests() throws Exception { - doTestWhenToIf("idea/testData/intentions/branched/ifWhen/whenToIf/whenWithRangeTests.kt"); - } - - @TestMetadata("whenWithRangeTestsAndMultiConditions.kt") - public void testWhenWithRangeTestsAndMultiConditions() throws Exception { - doTestWhenToIf("idea/testData/intentions/branched/ifWhen/whenToIf/whenWithRangeTestsAndMultiConditions.kt"); - } - - @TestMetadata("whenWithoutElse.kt") - public void testWhenWithoutElse() throws Exception { - doTestWhenToIf("idea/testData/intentions/branched/ifWhen/whenToIf/whenWithoutElse.kt"); - } - - @TestMetadata("whenWithoutSubject.kt") - public void testWhenWithoutSubject() throws Exception { - doTestWhenToIf("idea/testData/intentions/branched/ifWhen/whenToIf/whenWithoutSubject.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/branched/when/flatten") - public static class Flatten extends AbstractCodeTransformationTest { - public void testAllFilesPresentInFlatten() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/when/flatten"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("flattenWithSubject.kt") - public void testFlattenWithSubject() throws Exception { - doTestFlattenWhen("idea/testData/intentions/branched/when/flatten/flattenWithSubject.kt"); - } - - @TestMetadata("flattenWithUnmatchedSubjects.kt") - public void testFlattenWithUnmatchedSubjects() throws Exception { - doTestFlattenWhen("idea/testData/intentions/branched/when/flatten/flattenWithUnmatchedSubjects.kt"); - } - - @TestMetadata("flattenWithoutSubject.kt") - public void testFlattenWithoutSubject() throws Exception { - doTestFlattenWhen("idea/testData/intentions/branched/when/flatten/flattenWithoutSubject.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/branched/when/merge") - public static class Merge extends AbstractCodeTransformationTest { - public void testAllFilesPresentInMerge() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/when/merge"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("mergeBlockWithBlock.kt") - public void testMergeBlockWithBlock() throws Exception { - doTestMergeWhen("idea/testData/intentions/branched/when/merge/mergeBlockWithBlock.kt"); - } - - @TestMetadata("mergeBlockWithSingle.kt") - public void testMergeBlockWithSingle() throws Exception { - doTestMergeWhen("idea/testData/intentions/branched/when/merge/mergeBlockWithSingle.kt"); - } - - @TestMetadata("mergeWithConflictingDeclarations.kt") - public void testMergeWithConflictingDeclarations() throws Exception { - doTestMergeWhen("idea/testData/intentions/branched/when/merge/mergeWithConflictingDeclarations.kt"); - } - - @TestMetadata("mergeWithDeclarations.kt") - public void testMergeWithDeclarations() throws Exception { - doTestMergeWhen("idea/testData/intentions/branched/when/merge/mergeWithDeclarations.kt"); - } - - @TestMetadata("mergeWithReturnAfter.kt") - public void testMergeWithReturnAfter() throws Exception { - doTestMergeWhen("idea/testData/intentions/branched/when/merge/mergeWithReturnAfter.kt"); - } - - @TestMetadata("mergeWithReturnBefore.kt") - public void testMergeWithReturnBefore() throws Exception { - doTestMergeWhen("idea/testData/intentions/branched/when/merge/mergeWithReturnBefore.kt"); - } - - @TestMetadata("mergeWithSubject.kt") - public void testMergeWithSubject() throws Exception { - doTestMergeWhen("idea/testData/intentions/branched/when/merge/mergeWithSubject.kt"); - } - - @TestMetadata("mergeWithUnmatchedConditions1.kt") - public void testMergeWithUnmatchedConditions1() throws Exception { - doTestMergeWhen("idea/testData/intentions/branched/when/merge/mergeWithUnmatchedConditions1.kt"); - } - - @TestMetadata("mergeWithUnmatchedConditions2.kt") - public void testMergeWithUnmatchedConditions2() throws Exception { - doTestMergeWhen("idea/testData/intentions/branched/when/merge/mergeWithUnmatchedConditions2.kt"); - } - - @TestMetadata("mergeWithUnmatchedConditions3.kt") - public void testMergeWithUnmatchedConditions3() throws Exception { - doTestMergeWhen("idea/testData/intentions/branched/when/merge/mergeWithUnmatchedConditions3.kt"); - } - - @TestMetadata("mergeWithUnmatchedConditions4.kt") - public void testMergeWithUnmatchedConditions4() throws Exception { - doTestMergeWhen("idea/testData/intentions/branched/when/merge/mergeWithUnmatchedConditions4.kt"); - } - - @TestMetadata("mergeWithUnmatchedConditions5.kt") - public void testMergeWithUnmatchedConditions5() throws Exception { - doTestMergeWhen("idea/testData/intentions/branched/when/merge/mergeWithUnmatchedConditions5.kt"); - } - - @TestMetadata("mergeWithUnmatchedConditions6.kt") - public void testMergeWithUnmatchedConditions6() throws Exception { - doTestMergeWhen("idea/testData/intentions/branched/when/merge/mergeWithUnmatchedConditions6.kt"); - } - - @TestMetadata("mergeWithUnmatchedConditions7.kt") - public void testMergeWithUnmatchedConditions7() throws Exception { - doTestMergeWhen("idea/testData/intentions/branched/when/merge/mergeWithUnmatchedConditions7.kt"); - } - - @TestMetadata("mergeWithUnmatchedSubjects1.kt") - public void testMergeWithUnmatchedSubjects1() throws Exception { - doTestMergeWhen("idea/testData/intentions/branched/when/merge/mergeWithUnmatchedSubjects1.kt"); - } - - @TestMetadata("mergeWithUnmatchedSubjects2.kt") - public void testMergeWithUnmatchedSubjects2() throws Exception { - doTestMergeWhen("idea/testData/intentions/branched/when/merge/mergeWithUnmatchedSubjects2.kt"); - } - - @TestMetadata("mergeWithoutSubject.kt") - public void testMergeWithoutSubject() throws Exception { - doTestMergeWhen("idea/testData/intentions/branched/when/merge/mergeWithoutSubject.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/branched/when/introduceSubject") - public static class IntroduceSubject extends AbstractCodeTransformationTest { - public void testAllFilesPresentInIntroduceSubject() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/when/introduceSubject"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("whenWithEqualityTests.kt") - public void testWhenWithEqualityTests() throws Exception { - doTestIntroduceWhenSubject("idea/testData/intentions/branched/when/introduceSubject/whenWithEqualityTests.kt"); - } - - @TestMetadata("whenWithMultipleConditionTypes.kt") - public void testWhenWithMultipleConditionTypes() throws Exception { - doTestIntroduceWhenSubject("idea/testData/intentions/branched/when/introduceSubject/whenWithMultipleConditionTypes.kt"); - } - - @TestMetadata("whenWithNegativePatterns.kt") - public void testWhenWithNegativePatterns() throws Exception { - doTestIntroduceWhenSubject("idea/testData/intentions/branched/when/introduceSubject/whenWithNegativePatterns.kt"); - } - - @TestMetadata("whenWithNegativeRangeTests.kt") - public void testWhenWithNegativeRangeTests() throws Exception { - doTestIntroduceWhenSubject("idea/testData/intentions/branched/when/introduceSubject/whenWithNegativeRangeTests.kt"); - } - - @TestMetadata("whenWithNondivisibleConditions.kt") - public void testWhenWithNondivisibleConditions() throws Exception { - doTestIntroduceWhenSubject("idea/testData/intentions/branched/when/introduceSubject/whenWithNondivisibleConditions.kt"); - } - - @TestMetadata("whenWithPatterns.kt") - public void testWhenWithPatterns() throws Exception { - doTestIntroduceWhenSubject("idea/testData/intentions/branched/when/introduceSubject/whenWithPatterns.kt"); - } - - @TestMetadata("whenWithRangeTests.kt") - public void testWhenWithRangeTests() throws Exception { - doTestIntroduceWhenSubject("idea/testData/intentions/branched/when/introduceSubject/whenWithRangeTests.kt"); - } - - @TestMetadata("whenWithRangeTestsAndMultiConditions.kt") - public void testWhenWithRangeTestsAndMultiConditions() throws Exception { - doTestIntroduceWhenSubject("idea/testData/intentions/branched/when/introduceSubject/whenWithRangeTestsAndMultiConditions.kt"); - } - - @TestMetadata("whenWithSubject.kt") - public void testWhenWithSubject() throws Exception { - doTestIntroduceWhenSubject("idea/testData/intentions/branched/when/introduceSubject/whenWithSubject.kt"); - } - - @TestMetadata("whenWithSwappedEqualityTests.kt") - public void testWhenWithSwappedEqualityTests() throws Exception { - doTestIntroduceWhenSubject("idea/testData/intentions/branched/when/introduceSubject/whenWithSwappedEqualityTests.kt"); - } - - @TestMetadata("whenWithUnmatchedCandidateSubjects.kt") - public void testWhenWithUnmatchedCandidateSubjects() throws Exception { - doTestIntroduceWhenSubject("idea/testData/intentions/branched/when/introduceSubject/whenWithUnmatchedCandidateSubjects.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/branched/when/eliminateSubject") - public static class EliminateSubject extends AbstractCodeTransformationTest { - public void testAllFilesPresentInEliminateSubject() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/when/eliminateSubject"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("whenWithEqualityTests.kt") - public void testWhenWithEqualityTests() throws Exception { - doTestEliminateWhenSubject("idea/testData/intentions/branched/when/eliminateSubject/whenWithEqualityTests.kt"); - } - - @TestMetadata("whenWithMultipleConditionTypes.kt") - public void testWhenWithMultipleConditionTypes() throws Exception { - doTestEliminateWhenSubject("idea/testData/intentions/branched/when/eliminateSubject/whenWithMultipleConditionTypes.kt"); - } - - @TestMetadata("whenWithNegativePatterns.kt") - public void testWhenWithNegativePatterns() throws Exception { - doTestEliminateWhenSubject("idea/testData/intentions/branched/when/eliminateSubject/whenWithNegativePatterns.kt"); - } - - @TestMetadata("whenWithNegativeRangeTests.kt") - public void testWhenWithNegativeRangeTests() throws Exception { - doTestEliminateWhenSubject("idea/testData/intentions/branched/when/eliminateSubject/whenWithNegativeRangeTests.kt"); - } - - @TestMetadata("whenWithPatterns.kt") - public void testWhenWithPatterns() throws Exception { - doTestEliminateWhenSubject("idea/testData/intentions/branched/when/eliminateSubject/whenWithPatterns.kt"); - } - - @TestMetadata("whenWithRangeTests.kt") - public void testWhenWithRangeTests() throws Exception { - doTestEliminateWhenSubject("idea/testData/intentions/branched/when/eliminateSubject/whenWithRangeTests.kt"); - } - - @TestMetadata("whenWithRangeTestsAndMultiConditions.kt") - public void testWhenWithRangeTestsAndMultiConditions() throws Exception { - doTestEliminateWhenSubject("idea/testData/intentions/branched/when/eliminateSubject/whenWithRangeTestsAndMultiConditions.kt"); - } - - @TestMetadata("whenWithoutSubject.kt") - public void testWhenWithoutSubject() throws Exception { - doTestEliminateWhenSubject("idea/testData/intentions/branched/when/eliminateSubject/whenWithoutSubject.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/declarations/split") - public static class Split extends AbstractCodeTransformationTest { - public void testAllFilesPresentInSplit() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/declarations/split"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("longInit.kt") - public void testLongInit() throws Exception { - doTestSplitProperty("idea/testData/intentions/declarations/split/longInit.kt"); - } - - @TestMetadata("longInit2.kt") - public void testLongInit2() throws Exception { - doTestSplitProperty("idea/testData/intentions/declarations/split/longInit2.kt"); - } - - @TestMetadata("noInitializer.kt") - public void testNoInitializer() throws Exception { - doTestSplitProperty("idea/testData/intentions/declarations/split/noInitializer.kt"); - } - - @TestMetadata("noInitializer2.kt") - public void testNoInitializer2() throws Exception { - doTestSplitProperty("idea/testData/intentions/declarations/split/noInitializer2.kt"); - } - - @TestMetadata("nonLocalProperty.kt") - public void testNonLocalProperty() throws Exception { - doTestSplitProperty("idea/testData/intentions/declarations/split/nonLocalProperty.kt"); - } - - @TestMetadata("nonLocalProperty2.kt") - public void testNonLocalProperty2() throws Exception { - doTestSplitProperty("idea/testData/intentions/declarations/split/nonLocalProperty2.kt"); - } - - @TestMetadata("simpleInit.kt") - public void testSimpleInit() throws Exception { - doTestSplitProperty("idea/testData/intentions/declarations/split/simpleInit.kt"); - } - - @TestMetadata("simpleInit2.kt") - public void testSimpleInit2() throws Exception { - doTestSplitProperty("idea/testData/intentions/declarations/split/simpleInit2.kt"); - } - - @TestMetadata("simpleInitWithErrorType.kt") - public void testSimpleInitWithErrorType() throws Exception { - doTestSplitProperty("idea/testData/intentions/declarations/split/simpleInitWithErrorType.kt"); - } - - @TestMetadata("simpleInitWithErrorType2.kt") - public void testSimpleInitWithErrorType2() throws Exception { - doTestSplitProperty("idea/testData/intentions/declarations/split/simpleInitWithErrorType2.kt"); - } - - @TestMetadata("simpleInitWithType.kt") - public void testSimpleInitWithType() throws Exception { - doTestSplitProperty("idea/testData/intentions/declarations/split/simpleInitWithType.kt"); - } - - @TestMetadata("simpleInitWithType2.kt") - public void testSimpleInitWithType2() throws Exception { - doTestSplitProperty("idea/testData/intentions/declarations/split/simpleInitWithType2.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/declarations/convertMemberToExtension") - public static class ConvertMemberToExtension extends AbstractCodeTransformationTest { - @TestMetadata("abstract.kt") - public void testAbstract() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/abstract.kt"); - } - - @TestMetadata("abstractProperty.kt") - public void testAbstractProperty() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/abstractProperty.kt"); - } - - public void testAllFilesPresentInConvertMemberToExtension() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/declarations/convertMemberToExtension"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("explicitUnit.kt") - public void testExplicitUnit() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/explicitUnit.kt"); - } - - @TestMetadata("extension.kt") - public void testExtension() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/extension.kt"); - } - - @TestMetadata("funcitonNoName.kt") - public void testFuncitonNoName() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/funcitonNoName.kt"); - } - - @TestMetadata("functionType.kt") - public void testFunctionType() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/functionType.kt"); - } - - @TestMetadata("genericClass.kt") - public void testGenericClass() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/genericClass.kt"); - } - - @TestMetadata("genericFun.kt") - public void testGenericFun() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/genericFun.kt"); - } - - @TestMetadata("genericFunInGenericClass.kt") - public void testGenericFunInGenericClass() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/genericFunInGenericClass.kt"); - } - - @TestMetadata("genericFunInGenericClassWithUpperBounds.kt") - public void testGenericFunInGenericClassWithUpperBounds() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/genericFunInGenericClassWithUpperBounds.kt"); - } - - @TestMetadata("genericFunParamAfterName.kt") - public void testGenericFunParamAfterName() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/genericFunParamAfterName.kt"); - } - - @TestMetadata("genericProperty.kt") - public void testGenericProperty() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/genericProperty.kt"); - } - - @TestMetadata("inFunctionBody.kt") - public void testInFunctionBody() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/inFunctionBody.kt"); - } - - @TestMetadata("inObject.kt") - public void testInObject() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/inObject.kt"); - } - - @TestMetadata("internal.kt") - public void testInternal() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/internal.kt"); - } - - @TestMetadata("localFunction.kt") - public void testLocalFunction() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/localFunction.kt"); - } - - @TestMetadata("nonBlockBodyNoType.kt") - public void testNonBlockBodyNoType() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/nonBlockBodyNoType.kt"); - } - - @TestMetadata("nonBlockBodyWithType.kt") - public void testNonBlockBodyWithType() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/nonBlockBodyWithType.kt"); - } - - @TestMetadata("outsideFunction.kt") - public void testOutsideFunction() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/outsideFunction.kt"); - } - - @TestMetadata("private.kt") - public void testPrivate() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/private.kt"); - } - - @TestMetadata("protected.kt") - public void testProtected() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/protected.kt"); - } - - @TestMetadata("public.kt") - public void testPublic() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/public.kt"); - } - - @TestMetadata("simple.kt") - public void testSimple() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/simple.kt"); - } - - @TestMetadata("topLevelFunction.kt") - public void testTopLevelFunction() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/topLevelFunction.kt"); - } - - @TestMetadata("typeFqName.kt") - public void testTypeFqName() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/typeFqName.kt"); - } - - @TestMetadata("unknownType.kt") - public void testUnknownType() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/unknownType.kt"); - } - - @TestMetadata("valWithDefaultGetter.kt") - public void testValWithDefaultGetter() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/valWithDefaultGetter.kt"); - } - - @TestMetadata("valWithGetter.kt") - public void testValWithGetter() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/valWithGetter.kt"); - } - - @TestMetadata("valWithGetterBlockBody.kt") - public void testValWithGetterBlockBody() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/valWithGetterBlockBody.kt"); - } - - @TestMetadata("varWithDefaultGetterAndSetter.kt") - public void testVarWithDefaultGetterAndSetter() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/varWithDefaultGetterAndSetter.kt"); - } - - @TestMetadata("varWithDefaultSetter.kt") - public void testVarWithDefaultSetter() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/varWithDefaultSetter.kt"); - } - - @TestMetadata("varWithGetter.kt") - public void testVarWithGetter() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/varWithGetter.kt"); - } - - @TestMetadata("varWithGetterAndSetter.kt") - public void testVarWithGetterAndSetter() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/varWithGetterAndSetter.kt"); - } - - @TestMetadata("varWithSetter.kt") - public void testVarWithSetter() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/varWithSetter.kt"); - } - - @TestMetadata("withType.kt") - public void testWithType() throws Exception { - doTestConvertMemberToExtension("idea/testData/intentions/declarations/convertMemberToExtension/withType.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/reconstructedType") - public static class ReconstructedType extends AbstractCodeTransformationTest { - public void testAllFilesPresentInReconstructedType() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/reconstructedType"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("completeGenericType.kt") - public void testCompleteGenericType() throws Exception { - doTestReconstructType("idea/testData/intentions/reconstructedType/completeGenericType.kt"); - } - - @TestMetadata("completeType.kt") - public void testCompleteType() throws Exception { - doTestReconstructType("idea/testData/intentions/reconstructedType/completeType.kt"); - } - - @TestMetadata("errorType.kt") - public void testErrorType() throws Exception { - doTestReconstructType("idea/testData/intentions/reconstructedType/errorType.kt"); - } - - @TestMetadata("reconstructableType.kt") - public void testReconstructableType() throws Exception { - doTestReconstructType("idea/testData/intentions/reconstructedType/reconstructableType.kt"); - } - - @TestMetadata("typeInDeclaration.kt") - public void testTypeInDeclaration() throws Exception { - doTestReconstructType("idea/testData/intentions/reconstructedType/typeInDeclaration.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/removeUnnecessaryParentheses") - public static class RemoveUnnecessaryParentheses extends AbstractCodeTransformationTest { - public void testAllFilesPresentInRemoveUnnecessaryParentheses() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/removeUnnecessaryParentheses"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("necessaryParentheses1.kt") - public void testNecessaryParentheses1() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/intentions/removeUnnecessaryParentheses/necessaryParentheses1.kt"); - } - - @TestMetadata("necessaryParentheses2.kt") - public void testNecessaryParentheses2() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/intentions/removeUnnecessaryParentheses/necessaryParentheses2.kt"); - } - - @TestMetadata("necessaryParentheses3.kt") - public void testNecessaryParentheses3() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/intentions/removeUnnecessaryParentheses/necessaryParentheses3.kt"); - } - - @TestMetadata("necessaryParentheses4.kt") - public void testNecessaryParentheses4() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/intentions/removeUnnecessaryParentheses/necessaryParentheses4.kt"); - } - - @TestMetadata("necessaryParentheses5.kt") - public void testNecessaryParentheses5() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/intentions/removeUnnecessaryParentheses/necessaryParentheses5.kt"); - } - - @TestMetadata("unnecessaryParentheses1.kt") - public void testUnnecessaryParentheses1() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses1.kt"); - } - - @TestMetadata("unnecessaryParentheses2.kt") - public void testUnnecessaryParentheses2() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses2.kt"); - } - - @TestMetadata("unnecessaryParentheses3.kt") - public void testUnnecessaryParentheses3() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses3.kt"); - } - - @TestMetadata("unnecessaryParentheses4.kt") - public void testUnnecessaryParentheses4() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses4.kt"); - } - - @TestMetadata("unnecessaryParentheses5.kt") - public void testUnnecessaryParentheses5() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses5.kt"); - } - - @TestMetadata("unnecessaryParentheses6.kt") - public void testUnnecessaryParentheses6() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses6.kt"); - } - - @TestMetadata("unnecessaryParentheses7.kt") - public void testUnnecessaryParentheses7() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses7.kt"); - } - - @TestMetadata("unnecessaryParentheses8.kt") - public void testUnnecessaryParentheses8() throws Exception { - doTestRemoveUnnecessaryParentheses("idea/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses8.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/replaceWithDotQualifiedMethodCall") - public static class ReplaceWithDotQualifiedMethodCall extends AbstractCodeTransformationTest { - public void testAllFilesPresentInReplaceWithDotQualifiedMethodCall() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/replaceWithDotQualifiedMethodCall"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("functionCallAfterInfixCall.kt") - public void testFunctionCallAfterInfixCall() throws Exception { - doTestReplaceWithDotQualifiedMethodCall("idea/testData/intentions/replaceWithDotQualifiedMethodCall/functionCallAfterInfixCall.kt"); - } - - @TestMetadata("functionLiteralArgument.kt") - public void testFunctionLiteralArgument() throws Exception { - doTestReplaceWithDotQualifiedMethodCall("idea/testData/intentions/replaceWithDotQualifiedMethodCall/functionLiteralArgument.kt"); - } - - @TestMetadata("nonApplicableBinaryOperation.kt") - public void testNonApplicableBinaryOperation() throws Exception { - doTestReplaceWithDotQualifiedMethodCall("idea/testData/intentions/replaceWithDotQualifiedMethodCall/nonApplicableBinaryOperation.kt"); - } - - @TestMetadata("nullAssertedCall.kt") - public void testNullAssertedCall() throws Exception { - doTestReplaceWithDotQualifiedMethodCall("idea/testData/intentions/replaceWithDotQualifiedMethodCall/nullAssertedCall.kt"); - } - - @TestMetadata("parenthesesAroundRightHandArgument.kt") - public void testParenthesesAroundRightHandArgument() throws Exception { - doTestReplaceWithDotQualifiedMethodCall("idea/testData/intentions/replaceWithDotQualifiedMethodCall/parenthesesAroundRightHandArgument.kt"); - } - - @TestMetadata("simpleInfixFunctionCall.kt") - public void testSimpleInfixFunctionCall() throws Exception { - doTestReplaceWithDotQualifiedMethodCall("idea/testData/intentions/replaceWithDotQualifiedMethodCall/simpleInfixFunctionCall.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/replaceWithInfixFunctionCall") - public static class ReplaceWithInfixFunctionCall extends AbstractCodeTransformationTest { - public void testAllFilesPresentInReplaceWithInfixFunctionCall() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/replaceWithInfixFunctionCall"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("binaryExpressionArgument.kt") - public void testBinaryExpressionArgument() throws Exception { - doTestReplaceWithInfixFunctionCall("idea/testData/intentions/replaceWithInfixFunctionCall/binaryExpressionArgument.kt"); - } - - @TestMetadata("caretInsideCalleeExpr.kt") - public void testCaretInsideCalleeExpr() throws Exception { - doTestReplaceWithInfixFunctionCall("idea/testData/intentions/replaceWithInfixFunctionCall/caretInsideCalleeExpr.kt"); - } - - @TestMetadata("caretInsideReceiverExpr.kt") - public void testCaretInsideReceiverExpr() throws Exception { - doTestReplaceWithInfixFunctionCall("idea/testData/intentions/replaceWithInfixFunctionCall/caretInsideReceiverExpr.kt"); - } - - @TestMetadata("doubleFunctionCall.kt") - public void testDoubleFunctionCall() throws Exception { - doTestReplaceWithInfixFunctionCall("idea/testData/intentions/replaceWithInfixFunctionCall/doubleFunctionCall.kt"); - } - - @TestMetadata("doubleFunctionCallWithoutParentheses.kt") - public void testDoubleFunctionCallWithoutParentheses() throws Exception { - doTestReplaceWithInfixFunctionCall("idea/testData/intentions/replaceWithInfixFunctionCall/doubleFunctionCallWithoutParentheses.kt"); - } - - @TestMetadata("firstParameterLabeled.kt") - public void testFirstParameterLabeled() throws Exception { - doTestReplaceWithInfixFunctionCall("idea/testData/intentions/replaceWithInfixFunctionCall/firstParameterLabeled.kt"); - } - - @TestMetadata("functionLiteralArgument.kt") - public void testFunctionLiteralArgument() throws Exception { - doTestReplaceWithInfixFunctionCall("idea/testData/intentions/replaceWithInfixFunctionCall/functionLiteralArgument.kt"); - } - - @TestMetadata("functionSafeCall.kt") - public void testFunctionSafeCall() throws Exception { - doTestReplaceWithInfixFunctionCall("idea/testData/intentions/replaceWithInfixFunctionCall/functionSafeCall.kt"); - } - - @TestMetadata("inapplicableCaretPosition.kt") - public void testInapplicableCaretPosition() throws Exception { - doTestReplaceWithInfixFunctionCall("idea/testData/intentions/replaceWithInfixFunctionCall/inapplicableCaretPosition.kt"); - } - - @TestMetadata("multipleArguments.kt") - public void testMultipleArguments() throws Exception { - doTestReplaceWithInfixFunctionCall("idea/testData/intentions/replaceWithInfixFunctionCall/multipleArguments.kt"); - } - - @TestMetadata("namedArgument.kt") - public void testNamedArgument() throws Exception { - doTestReplaceWithInfixFunctionCall("idea/testData/intentions/replaceWithInfixFunctionCall/namedArgument.kt"); - } - - @TestMetadata("nullAssertedReceiver.kt") - public void testNullAssertedReceiver() throws Exception { - doTestReplaceWithInfixFunctionCall("idea/testData/intentions/replaceWithInfixFunctionCall/nullAssertedReceiver.kt"); - } - - @TestMetadata("packageFunctionCall.kt") - public void testPackageFunctionCall() throws Exception { - doTestReplaceWithInfixFunctionCall("idea/testData/intentions/replaceWithInfixFunctionCall/packageFunctionCall.kt"); - } - - @TestMetadata("propertyAccess.kt") - public void testPropertyAccess() throws Exception { - doTestReplaceWithInfixFunctionCall("idea/testData/intentions/replaceWithInfixFunctionCall/propertyAccess.kt"); - } - - @TestMetadata("secondParameterLabeled.kt") - public void testSecondParameterLabeled() throws Exception { - doTestReplaceWithInfixFunctionCall("idea/testData/intentions/replaceWithInfixFunctionCall/secondParameterLabeled.kt"); - } - - @TestMetadata("simpleArgumentAndFunctionLiteralArgument.kt") - public void testSimpleArgumentAndFunctionLiteralArgument() throws Exception { - doTestReplaceWithInfixFunctionCall("idea/testData/intentions/replaceWithInfixFunctionCall/simpleArgumentAndFunctionLiteralArgument.kt"); - } - - @TestMetadata("simpleMethodCall.kt") - public void testSimpleMethodCall() throws Exception { - doTestReplaceWithInfixFunctionCall("idea/testData/intentions/replaceWithInfixFunctionCall/simpleMethodCall.kt"); - } - - @TestMetadata("singlePackageFunctionCall.kt") - public void testSinglePackageFunctionCall() throws Exception { - doTestReplaceWithInfixFunctionCall("idea/testData/intentions/replaceWithInfixFunctionCall/singlePackageFunctionCall.kt"); - } - - @TestMetadata("zeroArguments.kt") - public void testZeroArguments() throws Exception { - doTestReplaceWithInfixFunctionCall("idea/testData/intentions/replaceWithInfixFunctionCall/zeroArguments.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/removeCurlyBracesFromTemplate") - public static class RemoveCurlyBracesFromTemplate extends AbstractCodeTransformationTest { - public void testAllFilesPresentInRemoveCurlyBracesFromTemplate() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/removeCurlyBracesFromTemplate"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("necessaryBrackets1.kt") - public void testNecessaryBrackets1() throws Exception { - doTestRemoveCurlyFromTemplate("idea/testData/intentions/removeCurlyBracesFromTemplate/necessaryBrackets1.kt"); - } - - @TestMetadata("necessaryBrackets2.kt") - public void testNecessaryBrackets2() throws Exception { - doTestRemoveCurlyFromTemplate("idea/testData/intentions/removeCurlyBracesFromTemplate/necessaryBrackets2.kt"); - } - - @TestMetadata("necessaryBrackets3.kt") - public void testNecessaryBrackets3() throws Exception { - doTestRemoveCurlyFromTemplate("idea/testData/intentions/removeCurlyBracesFromTemplate/necessaryBrackets3.kt"); - } - - @TestMetadata("necessaryBrackets4.kt") - public void testNecessaryBrackets4() throws Exception { - doTestRemoveCurlyFromTemplate("idea/testData/intentions/removeCurlyBracesFromTemplate/necessaryBrackets4.kt"); - } - - @TestMetadata("necessaryBrackets5.kt") - public void testNecessaryBrackets5() throws Exception { - doTestRemoveCurlyFromTemplate("idea/testData/intentions/removeCurlyBracesFromTemplate/necessaryBrackets5.kt"); - } - - @TestMetadata("unnecessaryBrackets1.kt") - public void testUnnecessaryBrackets1() throws Exception { - doTestRemoveCurlyFromTemplate("idea/testData/intentions/removeCurlyBracesFromTemplate/unnecessaryBrackets1.kt"); - } - - @TestMetadata("unnecessaryBrackets2.kt") - public void testUnnecessaryBrackets2() throws Exception { - doTestRemoveCurlyFromTemplate("idea/testData/intentions/removeCurlyBracesFromTemplate/unnecessaryBrackets2.kt"); - } - - @TestMetadata("unnecessaryBrackets3.kt") - public void testUnnecessaryBrackets3() throws Exception { - doTestRemoveCurlyFromTemplate("idea/testData/intentions/removeCurlyBracesFromTemplate/unnecessaryBrackets3.kt"); - } - - @TestMetadata("unnecessaryBrackets4.kt") - public void testUnnecessaryBrackets4() throws Exception { - doTestRemoveCurlyFromTemplate("idea/testData/intentions/removeCurlyBracesFromTemplate/unnecessaryBrackets4.kt"); - } - - @TestMetadata("unnecessaryBrackets5.kt") - public void testUnnecessaryBrackets5() throws Exception { - doTestRemoveCurlyFromTemplate("idea/testData/intentions/removeCurlyBracesFromTemplate/unnecessaryBrackets5.kt"); - } - - @TestMetadata("unnecessaryBrackets6.kt") - public void testUnnecessaryBrackets6() throws Exception { - doTestRemoveCurlyFromTemplate("idea/testData/intentions/removeCurlyBracesFromTemplate/unnecessaryBrackets6.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/convertToStringTemplateIntention") - public static class ConvertToStringTemplateIntention extends AbstractCodeTransformationTest { - public void testAllFilesPresentInConvertToStringTemplateIntention() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/convertToStringTemplateIntention"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("backslashNMultilineString.kt") - public void testBackslashNMultilineString() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/backslashNMultilineString.kt"); - } - - @TestMetadata("combineEmptyStrings.kt") - public void testCombineEmptyStrings() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/combineEmptyStrings.kt"); - } - - @TestMetadata("combinesNonStringsAsStrings.kt") - public void testCombinesNonStringsAsStrings() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/combinesNonStringsAsStrings.kt"); - } - - @TestMetadata("combinesNonStringsAsStrings2.kt") - public void testCombinesNonStringsAsStrings2() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/combinesNonStringsAsStrings2.kt"); - } - - @TestMetadata("consecutiveNewlines.kt") - public void testConsecutiveNewlines() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/consecutiveNewlines.kt"); - } - - @TestMetadata("doesNotCorruptExistingTemplate.kt") - public void testDoesNotCorruptExistingTemplate() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/doesNotCorruptExistingTemplate.kt"); - } - - @TestMetadata("doesNotCorruptExistingTemplateWithBraces.kt") - public void testDoesNotCorruptExistingTemplateWithBraces() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/doesNotCorruptExistingTemplateWithBraces.kt"); - } - - @TestMetadata("insertBracesForSimpleNamedExpression.kt") - public void testInsertBracesForSimpleNamedExpression() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/insertBracesForSimpleNamedExpression.kt"); - } - - @TestMetadata("interpolate2StringConstants.kt") - public void testInterpolate2StringConstants() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/interpolate2StringConstants.kt"); - } - - @TestMetadata("interpolate2Vals.kt") - public void testInterpolate2Vals() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/interpolate2Vals.kt"); - } - - @TestMetadata("interpolate3Left.kt") - public void testInterpolate3Left() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/interpolate3Left.kt"); - } - - @TestMetadata("interpolate3Right.kt") - public void testInterpolate3Right() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/interpolate3Right.kt"); - } - - @TestMetadata("interpolateChar.kt") - public void testInterpolateChar() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/interpolateChar.kt"); - } - - @TestMetadata("interpolateDollarSign.kt") - public void testInterpolateDollarSign() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/interpolateDollarSign.kt"); - } - - @TestMetadata("interpolateMapAccess.kt") - public void testInterpolateMapAccess() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/interpolateMapAccess.kt"); - } - - @TestMetadata("interpolateMethodInvoke.kt") - public void testInterpolateMethodInvoke() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/interpolateMethodInvoke.kt"); - } - - @TestMetadata("interpolateMultiline.kt") - public void testInterpolateMultiline() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/interpolateMultiline.kt"); - } - - @TestMetadata("interpolateStringWithFloat.kt") - public void testInterpolateStringWithFloat() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/interpolateStringWithFloat.kt"); - } - - @TestMetadata("interpolateStringWithInt.kt") - public void testInterpolateStringWithInt() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/interpolateStringWithInt.kt"); - } - - @TestMetadata("multilineString.kt") - public void testMultilineString() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/multilineString.kt"); - } - - @TestMetadata("noBracesForLastSimpleExpression.kt") - public void testNoBracesForLastSimpleExpression() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/noBracesForLastSimpleExpression.kt"); - } - - @TestMetadata("noBracesSimpleFollowedByDot.kt") - public void testNoBracesSimpleFollowedByDot() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/noBracesSimpleFollowedByDot.kt"); - } - - @TestMetadata("notApplicableForErrorElement.kt") - public void testNotApplicableForErrorElement() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/notApplicableForErrorElement.kt"); - } - - @TestMetadata("onlyForConcat.kt") - public void testOnlyForConcat() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/onlyForConcat.kt"); - } - - @TestMetadata("onlyForStrings.kt") - public void testOnlyForStrings() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/onlyForStrings.kt"); - } - - @TestMetadata("requiresPlusOperator.kt") - public void testRequiresPlusOperator() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/requiresPlusOperator.kt"); - } - - @TestMetadata("tricky.kt") - public void testTricky() throws Exception { - doTestConvertToStringTemplate("idea/testData/intentions/convertToStringTemplateIntention/tricky.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/convertToConcatenatedStringIntention") - public static class ConvertToConcatenatedStringIntention extends AbstractCodeTransformationTest { - public void testAllFilesPresentInConvertToConcatenatedStringIntention() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/convertToConcatenatedStringIntention"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("embeddedIf.kt") - public void testEmbeddedIf() throws Exception { - doTestConvertToConcatenatedStringIntention("idea/testData/intentions/convertToConcatenatedStringIntention/embeddedIf.kt"); - } - - @TestMetadata("embeddedIfBraces.kt") - public void testEmbeddedIfBraces() throws Exception { - doTestConvertToConcatenatedStringIntention("idea/testData/intentions/convertToConcatenatedStringIntention/embeddedIfBraces.kt"); - } - - @TestMetadata("handlesEscapeString.kt") - public void testHandlesEscapeString() throws Exception { - doTestConvertToConcatenatedStringIntention("idea/testData/intentions/convertToConcatenatedStringIntention/handlesEscapeString.kt"); - } - - @TestMetadata("interpolate2StringConstants.kt") - public void testInterpolate2StringConstants() throws Exception { - doTestConvertToConcatenatedStringIntention("idea/testData/intentions/convertToConcatenatedStringIntention/interpolate2StringConstants.kt"); - } - - @TestMetadata("interpolate3.kt") - public void testInterpolate3() throws Exception { - doTestConvertToConcatenatedStringIntention("idea/testData/intentions/convertToConcatenatedStringIntention/interpolate3.kt"); - } - - @TestMetadata("interpolateChar.kt") - public void testInterpolateChar() throws Exception { - doTestConvertToConcatenatedStringIntention("idea/testData/intentions/convertToConcatenatedStringIntention/interpolateChar.kt"); - } - - @TestMetadata("interpolateConstants.kt") - public void testInterpolateConstants() throws Exception { - doTestConvertToConcatenatedStringIntention("idea/testData/intentions/convertToConcatenatedStringIntention/interpolateConstants.kt"); - } - - @TestMetadata("interpolateMapAccess.kt") - public void testInterpolateMapAccess() throws Exception { - doTestConvertToConcatenatedStringIntention("idea/testData/intentions/convertToConcatenatedStringIntention/interpolateMapAccess.kt"); - } - - @TestMetadata("interpolateMethodInvoke.kt") - public void testInterpolateMethodInvoke() throws Exception { - doTestConvertToConcatenatedStringIntention("idea/testData/intentions/convertToConcatenatedStringIntention/interpolateMethodInvoke.kt"); - } - - @TestMetadata("interpolateSimpleWithBraces.kt") - public void testInterpolateSimpleWithBraces() throws Exception { - doTestConvertToConcatenatedStringIntention("idea/testData/intentions/convertToConcatenatedStringIntention/interpolateSimpleWithBraces.kt"); - } - - @TestMetadata("interpolateStringWithFloat.kt") - public void testInterpolateStringWithFloat() throws Exception { - doTestConvertToConcatenatedStringIntention("idea/testData/intentions/convertToConcatenatedStringIntention/interpolateStringWithFloat.kt"); - } - - @TestMetadata("interpolateStringWithInt.kt") - public void testInterpolateStringWithInt() throws Exception { - doTestConvertToConcatenatedStringIntention("idea/testData/intentions/convertToConcatenatedStringIntention/interpolateStringWithInt.kt"); - } - - @TestMetadata("lastExprIsNamedExpression.kt") - public void testLastExprIsNamedExpression() throws Exception { - doTestConvertToConcatenatedStringIntention("idea/testData/intentions/convertToConcatenatedStringIntention/lastExprIsNamedExpression.kt"); - } - - @TestMetadata("multilineString.kt") - public void testMultilineString() throws Exception { - doTestConvertToConcatenatedStringIntention("idea/testData/intentions/convertToConcatenatedStringIntention/multilineString.kt"); - } - - @TestMetadata("multilineWhenExpr.kt") - public void testMultilineWhenExpr() throws Exception { - doTestConvertToConcatenatedStringIntention("idea/testData/intentions/convertToConcatenatedStringIntention/multilineWhenExpr.kt"); - } - - @TestMetadata("namedExprBetweenConstants.kt") - public void testNamedExprBetweenConstants() throws Exception { - doTestConvertToConcatenatedStringIntention("idea/testData/intentions/convertToConcatenatedStringIntention/namedExprBetweenConstants.kt"); - } - - @TestMetadata("notApplicableForErrorElement.kt") - public void testNotApplicableForErrorElement() throws Exception { - doTestConvertToConcatenatedStringIntention("idea/testData/intentions/convertToConcatenatedStringIntention/notApplicableForErrorElement.kt"); - } - - @TestMetadata("notApplicableForSimple.kt") - public void testNotApplicableForSimple() throws Exception { - doTestConvertToConcatenatedStringIntention("idea/testData/intentions/convertToConcatenatedStringIntention/notApplicableForSimple.kt"); - } - - @TestMetadata("notAvailableForDollarSignLiteral.kt") - public void testNotAvailableForDollarSignLiteral() throws Exception { - doTestConvertToConcatenatedStringIntention("idea/testData/intentions/convertToConcatenatedStringIntention/notAvailableForDollarSignLiteral.kt"); - } - - @TestMetadata("singleVar.kt") - public void testSingleVar() throws Exception { - doTestConvertToConcatenatedStringIntention("idea/testData/intentions/convertToConcatenatedStringIntention/singleVar.kt"); - } - - @TestMetadata("startsWithInt.kt") - public void testStartsWithInt() throws Exception { - doTestConvertToConcatenatedStringIntention("idea/testData/intentions/convertToConcatenatedStringIntention/startsWithInt.kt"); - } - - @TestMetadata("startsWithStringExpression.kt") - public void testStartsWithStringExpression() throws Exception { - doTestConvertToConcatenatedStringIntention("idea/testData/intentions/convertToConcatenatedStringIntention/startsWithStringExpression.kt"); - } - - @TestMetadata("tricky.kt") - public void testTricky() throws Exception { - doTestConvertToConcatenatedStringIntention("idea/testData/intentions/convertToConcatenatedStringIntention/tricky.kt"); - } - - @TestMetadata("withAndWithoutBraces.kt") - public void testWithAndWithoutBraces() throws Exception { - doTestConvertToConcatenatedStringIntention("idea/testData/intentions/convertToConcatenatedStringIntention/withAndWithoutBraces.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/moveLambdaInsideParentheses") - public static class MoveLambdaInsideParentheses extends AbstractCodeTransformationTest { - public void testAllFilesPresentInMoveLambdaInsideParentheses() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/moveLambdaInsideParentheses"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("inapplicable1.kt") - public void testInapplicable1() throws Exception { - doTestMoveLambdaInsideParentheses("idea/testData/intentions/moveLambdaInsideParentheses/inapplicable1.kt"); - } - - @TestMetadata("inapplicable2.kt") - public void testInapplicable2() throws Exception { - doTestMoveLambdaInsideParentheses("idea/testData/intentions/moveLambdaInsideParentheses/inapplicable2.kt"); - } - - @TestMetadata("moveLambda1.kt") - public void testMoveLambda1() throws Exception { - doTestMoveLambdaInsideParentheses("idea/testData/intentions/moveLambdaInsideParentheses/moveLambda1.kt"); - } - - @TestMetadata("moveLambda10.kt") - public void testMoveLambda10() throws Exception { - doTestMoveLambdaInsideParentheses("idea/testData/intentions/moveLambdaInsideParentheses/moveLambda10.kt"); - } - - @TestMetadata("moveLambda11.kt") - public void testMoveLambda11() throws Exception { - doTestMoveLambdaInsideParentheses("idea/testData/intentions/moveLambdaInsideParentheses/moveLambda11.kt"); - } - - @TestMetadata("moveLambda12.kt") - public void testMoveLambda12() throws Exception { - doTestMoveLambdaInsideParentheses("idea/testData/intentions/moveLambdaInsideParentheses/moveLambda12.kt"); - } - - @TestMetadata("moveLambda2.kt") - public void testMoveLambda2() throws Exception { - doTestMoveLambdaInsideParentheses("idea/testData/intentions/moveLambdaInsideParentheses/moveLambda2.kt"); - } - - @TestMetadata("moveLambda3.kt") - public void testMoveLambda3() throws Exception { - doTestMoveLambdaInsideParentheses("idea/testData/intentions/moveLambdaInsideParentheses/moveLambda3.kt"); - } - - @TestMetadata("moveLambda4.kt") - public void testMoveLambda4() throws Exception { - doTestMoveLambdaInsideParentheses("idea/testData/intentions/moveLambdaInsideParentheses/moveLambda4.kt"); - } - - @TestMetadata("moveLambda5.kt") - public void testMoveLambda5() throws Exception { - doTestMoveLambdaInsideParentheses("idea/testData/intentions/moveLambdaInsideParentheses/moveLambda5.kt"); - } - - @TestMetadata("moveLambda6.kt") - public void testMoveLambda6() throws Exception { - doTestMoveLambdaInsideParentheses("idea/testData/intentions/moveLambdaInsideParentheses/moveLambda6.kt"); - } - - @TestMetadata("moveLambda7.kt") - public void testMoveLambda7() throws Exception { - doTestMoveLambdaInsideParentheses("idea/testData/intentions/moveLambdaInsideParentheses/moveLambda7.kt"); - } - - @TestMetadata("moveLambda8.kt") - public void testMoveLambda8() throws Exception { - doTestMoveLambdaInsideParentheses("idea/testData/intentions/moveLambdaInsideParentheses/moveLambda8.kt"); - } - - @TestMetadata("moveLambda9.kt") - public void testMoveLambda9() throws Exception { - doTestMoveLambdaInsideParentheses("idea/testData/intentions/moveLambdaInsideParentheses/moveLambda9.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/moveLambdaOutsideParentheses") - public static class MoveLambdaOutsideParentheses extends AbstractCodeTransformationTest { - public void testAllFilesPresentInMoveLambdaOutsideParentheses() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/moveLambdaOutsideParentheses"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("inapplicable1.kt") - public void testInapplicable1() throws Exception { - doTestMoveLambdaOutsideParentheses("idea/testData/intentions/moveLambdaOutsideParentheses/inapplicable1.kt"); - } - - @TestMetadata("inapplicable2.kt") - public void testInapplicable2() throws Exception { - doTestMoveLambdaOutsideParentheses("idea/testData/intentions/moveLambdaOutsideParentheses/inapplicable2.kt"); - } - - @TestMetadata("inapplicable3.kt") - public void testInapplicable3() throws Exception { - doTestMoveLambdaOutsideParentheses("idea/testData/intentions/moveLambdaOutsideParentheses/inapplicable3.kt"); - } - - @TestMetadata("labeledLambda.kt") - public void testLabeledLambda() throws Exception { - doTestMoveLambdaOutsideParentheses("idea/testData/intentions/moveLambdaOutsideParentheses/labeledLambda.kt"); - } - - @TestMetadata("lambdaWithCommas.kt") - public void testLambdaWithCommas() throws Exception { - doTestMoveLambdaOutsideParentheses("idea/testData/intentions/moveLambdaOutsideParentheses/lambdaWithCommas.kt"); - } - - @TestMetadata("lambdaWithCommas2.kt") - public void testLambdaWithCommas2() throws Exception { - doTestMoveLambdaOutsideParentheses("idea/testData/intentions/moveLambdaOutsideParentheses/lambdaWithCommas2.kt"); - } - - @TestMetadata("lambdaWithCommas3.kt") - public void testLambdaWithCommas3() throws Exception { - doTestMoveLambdaOutsideParentheses("idea/testData/intentions/moveLambdaOutsideParentheses/lambdaWithCommas3.kt"); - } - - @TestMetadata("moveLambda1.kt") - public void testMoveLambda1() throws Exception { - doTestMoveLambdaOutsideParentheses("idea/testData/intentions/moveLambdaOutsideParentheses/moveLambda1.kt"); - } - - @TestMetadata("moveLambda2.kt") - public void testMoveLambda2() throws Exception { - doTestMoveLambdaOutsideParentheses("idea/testData/intentions/moveLambdaOutsideParentheses/moveLambda2.kt"); - } - - @TestMetadata("moveLambda3.kt") - public void testMoveLambda3() throws Exception { - doTestMoveLambdaOutsideParentheses("idea/testData/intentions/moveLambdaOutsideParentheses/moveLambda3.kt"); - } - - @TestMetadata("moveLambda4.kt") - public void testMoveLambda4() throws Exception { - doTestMoveLambdaOutsideParentheses("idea/testData/intentions/moveLambdaOutsideParentheses/moveLambda4.kt"); - } - - @TestMetadata("moveLambda7.kt") - public void testMoveLambda7() throws Exception { - doTestMoveLambdaOutsideParentheses("idea/testData/intentions/moveLambdaOutsideParentheses/moveLambda7.kt"); - } - - @TestMetadata("moveLambda8.kt") - public void testMoveLambda8() throws Exception { - doTestMoveLambdaOutsideParentheses("idea/testData/intentions/moveLambdaOutsideParentheses/moveLambda8.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt") - public static class ReplaceExplicitFunctionLiteralParamWithIt extends AbstractCodeTransformationTest { - public void testAllFilesPresentInReplaceExplicitFunctionLiteralParamWithIt() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("applicable_cursofOverParamInInnerLiteral.kt") - public void testApplicable_cursofOverParamInInnerLiteral() throws Exception { - doTestReplaceExplicitFunctionLiteralParamWithIt("idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt/applicable_cursofOverParamInInnerLiteral.kt"); - } - - @TestMetadata("applicable_cursorOverParameterDeclaration.kt") - public void testApplicable_cursorOverParameterDeclaration() throws Exception { - doTestReplaceExplicitFunctionLiteralParamWithIt("idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt/applicable_cursorOverParameterDeclaration.kt"); - } - - @TestMetadata("applicable_cursorOverParameterUse.kt") - public void testApplicable_cursorOverParameterUse() throws Exception { - doTestReplaceExplicitFunctionLiteralParamWithIt("idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt/applicable_cursorOverParameterUse.kt"); - } - - @TestMetadata("applicable_formatsProperly.kt") - public void testApplicable_formatsProperly() throws Exception { - doTestReplaceExplicitFunctionLiteralParamWithIt("idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt/applicable_formatsProperly.kt"); - } - - @TestMetadata("notApplicable_alreadyUsesImplicitIt.kt") - public void testNotApplicable_alreadyUsesImplicitIt() throws Exception { - doTestReplaceExplicitFunctionLiteralParamWithIt("idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt/notApplicable_alreadyUsesImplicitIt.kt"); - } - - @TestMetadata("notApplicable_hasMultipleParameters.kt") - public void testNotApplicable_hasMultipleParameters() throws Exception { - doTestReplaceExplicitFunctionLiteralParamWithIt("idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt/notApplicable_hasMultipleParameters.kt"); - } - - @TestMetadata("notApplicable_notFunctionLiteralParameter.kt") - public void testNotApplicable_notFunctionLiteralParameter() throws Exception { - doTestReplaceExplicitFunctionLiteralParamWithIt("idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt/notApplicable_notFunctionLiteralParameter.kt"); - } - - @TestMetadata("notApplicable_parameterHasExplicitType.kt") - public void testNotApplicable_parameterHasExplicitType() throws Exception { - doTestReplaceExplicitFunctionLiteralParamWithIt("idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt/notApplicable_parameterHasExplicitType.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/replaceItWithExplicitFunctionLiteralParam") - public static class ReplaceItWithExplicitFunctionLiteralParam extends AbstractCodeTransformationTest { - public void testAllFilesPresentInReplaceItWithExplicitFunctionLiteralParam() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/replaceItWithExplicitFunctionLiteralParam"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("applicable.kt") - public void testApplicable() throws Exception { - doTestReplaceItWithExplicitFunctionLiteralParam("idea/testData/intentions/replaceItWithExplicitFunctionLiteralParam/applicable.kt"); - } - - @TestMetadata("applicable_nestedFunctionLiterals.kt") - public void testApplicable_nestedFunctionLiterals() throws Exception { - doTestReplaceItWithExplicitFunctionLiteralParam("idea/testData/intentions/replaceItWithExplicitFunctionLiteralParam/applicable_nestedFunctionLiterals.kt"); - } - - @TestMetadata("applicable_nestedFunctionWithIt.kt") - public void testApplicable_nestedFunctionWithIt() throws Exception { - doTestReplaceItWithExplicitFunctionLiteralParam("idea/testData/intentions/replaceItWithExplicitFunctionLiteralParam/applicable_nestedFunctionWithIt.kt"); - } - - @TestMetadata("notApplicable_localVariableIt.kt") - public void testNotApplicable_localVariableIt() throws Exception { - doTestReplaceItWithExplicitFunctionLiteralParam("idea/testData/intentions/replaceItWithExplicitFunctionLiteralParam/notApplicable_localVariableIt.kt"); - } - - @TestMetadata("notApplicable_parameterExplicitlyNamedIt.kt") - public void testNotApplicable_parameterExplicitlyNamedIt() throws Exception { - doTestReplaceItWithExplicitFunctionLiteralParam("idea/testData/intentions/replaceItWithExplicitFunctionLiteralParam/notApplicable_parameterExplicitlyNamedIt.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/removeBraces") - public static class RemoveBraces extends AbstractCodeTransformationTest { - public void testAllFilesPresentInRemoveBraces() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/removeBraces"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("removeBracesForDoWhile.kt") - public void testRemoveBracesForDoWhile() throws Exception { - doTestRemoveBraces("idea/testData/intentions/removeBraces/removeBracesForDoWhile.kt"); - } - - @TestMetadata("removeBracesForDoWhileWithTwoStatements.kt") - public void testRemoveBracesForDoWhileWithTwoStatements() throws Exception { - doTestRemoveBraces("idea/testData/intentions/removeBraces/removeBracesForDoWhileWithTwoStatements.kt"); - } - - @TestMetadata("removeBracesForElse.kt") - public void testRemoveBracesForElse() throws Exception { - doTestRemoveBraces("idea/testData/intentions/removeBraces/removeBracesForElse.kt"); - } - - @TestMetadata("removeBracesForFor.kt") - public void testRemoveBracesForFor() throws Exception { - doTestRemoveBraces("idea/testData/intentions/removeBraces/removeBracesForFor.kt"); - } - - @TestMetadata("removeBracesForIf.kt") - public void testRemoveBracesForIf() throws Exception { - doTestRemoveBraces("idea/testData/intentions/removeBraces/removeBracesForIf.kt"); - } - - @TestMetadata("removeBracesForIfWithComment.kt") - public void testRemoveBracesForIfWithComment() throws Exception { - doTestRemoveBraces("idea/testData/intentions/removeBraces/removeBracesForIfWithComment.kt"); - } - - @TestMetadata("removeBracesForIfWithNoStatement.kt") - public void testRemoveBracesForIfWithNoStatement() throws Exception { - doTestRemoveBraces("idea/testData/intentions/removeBraces/removeBracesForIfWithNoStatement.kt"); - } - - @TestMetadata("removeBracesForIfWithSemicolon.kt") - public void testRemoveBracesForIfWithSemicolon() throws Exception { - doTestRemoveBraces("idea/testData/intentions/removeBraces/removeBracesForIfWithSemicolon.kt"); - } - - @TestMetadata("removeBracesForIfWithTwoStatements.kt") - public void testRemoveBracesForIfWithTwoStatements() throws Exception { - doTestRemoveBraces("idea/testData/intentions/removeBraces/removeBracesForIfWithTwoStatements.kt"); - } - - @TestMetadata("removeBracesForWhile.kt") - public void testRemoveBracesForWhile() throws Exception { - doTestRemoveBraces("idea/testData/intentions/removeBraces/removeBracesForWhile.kt"); - } - - @TestMetadata("removeBracesForWhileWithTwoStatements.kt") - public void testRemoveBracesForWhileWithTwoStatements() throws Exception { - doTestRemoveBraces("idea/testData/intentions/removeBraces/removeBracesForWhileWithTwoStatements.kt"); - } - + public void testAllFilesPresentInIntentions() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions"), Pattern.compile("^(.+)\\.kt$"), true); } @TestMetadata("idea/testData/intentions/addBraces") public static class AddBraces extends AbstractCodeTransformationTest { @TestMetadata("addBracesForDoWhile.kt") public void testAddBracesForDoWhile() throws Exception { - doTestAddBraces("idea/testData/intentions/addBraces/addBracesForDoWhile.kt"); + doTest("idea/testData/intentions/addBraces/addBracesForDoWhile.kt"); } @TestMetadata("addBracesForElse.kt") public void testAddBracesForElse() throws Exception { - doTestAddBraces("idea/testData/intentions/addBraces/addBracesForElse.kt"); + doTest("idea/testData/intentions/addBraces/addBracesForElse.kt"); } @TestMetadata("addBracesForFor.kt") public void testAddBracesForFor() throws Exception { - doTestAddBraces("idea/testData/intentions/addBraces/addBracesForFor.kt"); + doTest("idea/testData/intentions/addBraces/addBracesForFor.kt"); } @TestMetadata("addBracesForIf.kt") public void testAddBracesForIf() throws Exception { - doTestAddBraces("idea/testData/intentions/addBraces/addBracesForIf.kt"); + doTest("idea/testData/intentions/addBraces/addBracesForIf.kt"); } @TestMetadata("addBracesForIfWithNoSpace.kt") public void testAddBracesForIfWithNoSpace() throws Exception { - doTestAddBraces("idea/testData/intentions/addBraces/addBracesForIfWithNoSpace.kt"); + doTest("idea/testData/intentions/addBraces/addBracesForIfWithNoSpace.kt"); } @TestMetadata("addBracesForIfWithSemicolon.kt") public void testAddBracesForIfWithSemicolon() throws Exception { - doTestAddBraces("idea/testData/intentions/addBraces/addBracesForIfWithSemicolon.kt"); + doTest("idea/testData/intentions/addBraces/addBracesForIfWithSemicolon.kt"); } @TestMetadata("addBracesForWhile.kt") public void testAddBracesForWhile() throws Exception { - doTestAddBraces("idea/testData/intentions/addBraces/addBracesForWhile.kt"); + doTest("idea/testData/intentions/addBraces/addBracesForWhile.kt"); } @TestMetadata("addBracesWithBraces.kt") public void testAddBracesWithBraces() throws Exception { - doTestAddBraces("idea/testData/intentions/addBraces/addBracesWithBraces.kt"); + doTest("idea/testData/intentions/addBraces/addBracesWithBraces.kt"); } public void testAllFilesPresentInAddBraces() throws Exception { @@ -2708,496 +85,2210 @@ public class CodeTransformationTestGenerated extends AbstractCodeTransformationT } - @TestMetadata("idea/testData/intentions/attributeCallReplacements/replaceGetIntention") - @InnerTestClasses({}) - public static class ReplaceGetIntention extends AbstractCodeTransformationTest { - @TestMetadata("acceptableVararg.kt") - public void testAcceptableVararg() throws Exception { - doTestReplaceGetIntention("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/acceptableVararg.kt"); + @TestMetadata("idea/testData/intentions/attributeCallReplacements") + @InnerTestClasses({AttributeCallReplacements.ReplaceBinaryInfixIntention.class, AttributeCallReplacements.ReplaceContainsIntention.class, AttributeCallReplacements.ReplaceGetIntention.class, AttributeCallReplacements.ReplaceInvokeIntention.class, AttributeCallReplacements.ReplaceUnaryPrefixIntention.class}) + public static class AttributeCallReplacements extends AbstractCodeTransformationTest { + public void testAllFilesPresentInAttributeCallReplacements() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/attributeCallReplacements"), Pattern.compile("^(.+)\\.kt$"), true); } - public void testAllFilesPresentInReplaceGetIntention() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/attributeCallReplacements/replaceGetIntention"), Pattern.compile("^(.+)\\.kt$"), true); + @TestMetadata("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention") + public static class ReplaceBinaryInfixIntention extends AbstractCodeTransformationTest { + @TestMetadata("acceptableVararg1.kt") + public void testAcceptableVararg1() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/acceptableVararg1.kt"); + } + + @TestMetadata("acceptableVararg2.kt") + public void testAcceptableVararg2() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/acceptableVararg2.kt"); + } + + public void testAllFilesPresentInReplaceBinaryInfixIntention() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("allowableDefaultArgument.kt") + public void testAllowableDefaultArgument() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/allowableDefaultArgument.kt"); + } + + @TestMetadata("divSanityTest.kt") + public void testDivSanityTest() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/divSanityTest.kt"); + } + + @TestMetadata("extensionFunction.kt") + public void testExtensionFunction() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/extensionFunction.kt"); + } + + @TestMetadata("functionLiteralArgument.kt") + public void testFunctionLiteralArgument() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/functionLiteralArgument.kt"); + } + + @TestMetadata("minusSanityTest.kt") + public void testMinusSanityTest() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/minusSanityTest.kt"); + } + + @TestMetadata("missingDefaultArgument.kt") + public void testMissingDefaultArgument() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/missingDefaultArgument.kt"); + } + + @TestMetadata("modSanityTest.kt") + public void testModSanityTest() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/modSanityTest.kt"); + } + + @TestMetadata("multipleArguments.kt") + public void testMultipleArguments() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/multipleArguments.kt"); + } + + @TestMetadata("plusSanityTest.kt") + public void testPlusSanityTest() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/plusSanityTest.kt"); + } + + @TestMetadata("rangeToSanityTest.kt") + public void testRangeToSanityTest() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/rangeToSanityTest.kt"); + } + + @TestMetadata("timesSanityTest.kt") + public void testTimesSanityTest() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/timesSanityTest.kt"); + } + + @TestMetadata("typeArguments.kt") + public void testTypeArguments() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/typeArguments.kt"); + } + + @TestMetadata("unacceptableVararg1.kt") + public void testUnacceptableVararg1() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/unacceptableVararg1.kt"); + } + + @TestMetadata("unacceptableVararg2.kt") + public void testUnacceptableVararg2() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/unacceptableVararg2.kt"); + } + + @TestMetadata("validNamedArgument.kt") + public void testValidNamedArgument() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/validNamedArgument.kt"); + } + } - @TestMetadata("argumentAndFunction.kt") - public void testArgumentAndFunction() throws Exception { - doTestReplaceGetIntention("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/argumentAndFunction.kt"); + @TestMetadata("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention") + public static class ReplaceContainsIntention extends AbstractCodeTransformationTest { + @TestMetadata("acceptableVararg.kt") + public void testAcceptableVararg() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/acceptableVararg.kt"); + } + + @TestMetadata("acceptableVararg2.kt") + public void testAcceptableVararg2() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/acceptableVararg2.kt"); + } + + public void testAllFilesPresentInReplaceContainsIntention() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("allowableDefaultArgument.kt") + public void testAllowableDefaultArgument() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/allowableDefaultArgument.kt"); + } + + @TestMetadata("containsInExpression.kt") + public void testContainsInExpression() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/containsInExpression.kt"); + } + + @TestMetadata("extensionFunction.kt") + public void testExtensionFunction() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/extensionFunction.kt"); + } + + @TestMetadata("functionLiteralArgument.kt") + public void testFunctionLiteralArgument() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/functionLiteralArgument.kt"); + } + + @TestMetadata("functionLiteralArgumentAfterSemicolon.kt") + public void testFunctionLiteralArgumentAfterSemicolon() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/functionLiteralArgumentAfterSemicolon.kt"); + } + + @TestMetadata("functionLiteralArgumentAtStartOfBlock.kt") + public void testFunctionLiteralArgumentAtStartOfBlock() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/functionLiteralArgumentAtStartOfBlock.kt"); + } + + @TestMetadata("functionLiteralArgumentInExpression.kt") + public void testFunctionLiteralArgumentInExpression() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/functionLiteralArgumentInExpression.kt"); + } + + @TestMetadata("invalidArgument.kt") + public void testInvalidArgument() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/invalidArgument.kt"); + } + + @TestMetadata("missingArgument.kt") + public void testMissingArgument() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/missingArgument.kt"); + } + + @TestMetadata("missingDefaultArgument.kt") + public void testMissingDefaultArgument() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/missingDefaultArgument.kt"); + } + + @TestMetadata("multipleArguments.kt") + public void testMultipleArguments() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/multipleArguments.kt"); + } + + @TestMetadata("simpleArgument.kt") + public void testSimpleArgument() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/simpleArgument.kt"); + } + + @TestMetadata("typeArguments.kt") + public void testTypeArguments() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/typeArguments.kt"); + } + + @TestMetadata("unacceptableVararg1.kt") + public void testUnacceptableVararg1() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/unacceptableVararg1.kt"); + } + + @TestMetadata("unacceptableVararg2.kt") + public void testUnacceptableVararg2() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/unacceptableVararg2.kt"); + } + + @TestMetadata("validNamedArgument.kt") + public void testValidNamedArgument() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/validNamedArgument.kt"); + } + } - @TestMetadata("duplicateArguments.kt") - public void testDuplicateArguments() throws Exception { - doTestReplaceGetIntention("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/duplicateArguments.kt"); + @TestMetadata("idea/testData/intentions/attributeCallReplacements/replaceGetIntention") + @InnerTestClasses({}) + public static class ReplaceGetIntention extends AbstractCodeTransformationTest { + @TestMetadata("acceptableVararg.kt") + public void testAcceptableVararg() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/acceptableVararg.kt"); + } + + public void testAllFilesPresentInReplaceGetIntention() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/attributeCallReplacements/replaceGetIntention"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("argumentAndFunction.kt") + public void testArgumentAndFunction() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/argumentAndFunction.kt"); + } + + @TestMetadata("duplicateArguments.kt") + public void testDuplicateArguments() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/duplicateArguments.kt"); + } + + @TestMetadata("extensionFunction.kt") + public void testExtensionFunction() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/extensionFunction.kt"); + } + + @TestMetadata("functionalArgument.kt") + public void testFunctionalArgument() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/functionalArgument.kt"); + } + + @TestMetadata("invalidArgument.kt") + public void testInvalidArgument() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/invalidArgument.kt"); + } + + @TestMetadata("missingArgument.kt") + public void testMissingArgument() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/missingArgument.kt"); + } + + @TestMetadata("missingDefaultArgument.kt") + public void testMissingDefaultArgument() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/missingDefaultArgument.kt"); + } + + @TestMetadata("multiArgument.kt") + public void testMultiArgument() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/multiArgument.kt"); + } + + @TestMetadata("namedAndFunction.kt") + public void testNamedAndFunction() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/namedAndFunction.kt"); + } + + @TestMetadata("noArgument.kt") + public void testNoArgument() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/noArgument.kt"); + } + + @TestMetadata("sanityCheck.kt") + public void testSanityCheck() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/sanityCheck.kt"); + } + + @TestMetadata("singleArgument.kt") + public void testSingleArgument() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/singleArgument.kt"); + } + + @TestMetadata("singleNamedArgument.kt") + public void testSingleNamedArgument() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/singleNamedArgument.kt"); + } + + @TestMetadata("unacceptableVararg.kt") + public void testUnacceptableVararg() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/unacceptableVararg.kt"); + } + + @TestMetadata("unnamedAndNamed.kt") + public void testUnnamedAndNamed() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/unnamedAndNamed.kt"); + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("ReplaceGetIntention"); + suite.addTestSuite(ReplaceGetIntention.class); + return suite; + } } - @TestMetadata("extensionFunction.kt") - public void testExtensionFunction() throws Exception { - doTestReplaceGetIntention("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/extensionFunction.kt"); + @TestMetadata("idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention") + public static class ReplaceInvokeIntention extends AbstractCodeTransformationTest { + public void testAllFilesPresentInReplaceInvokeIntention() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("extensionFunction.kt") + public void testExtensionFunction() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/extensionFunction.kt"); + } + + @TestMetadata("functionLiteralInvoke.kt") + public void testFunctionLiteralInvoke() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/functionLiteralInvoke.kt"); + } + + @TestMetadata("invokeInExpression.kt") + public void testInvokeInExpression() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/invokeInExpression.kt"); + } + + @TestMetadata("namedArgumentInvoke.kt") + public void testNamedArgumentInvoke() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/namedArgumentInvoke.kt"); + } + + @TestMetadata("noArgumentInvoke.kt") + public void testNoArgumentInvoke() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/noArgumentInvoke.kt"); + } + + @TestMetadata("typeAndValueArgument.kt") + public void testTypeAndValueArgument() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/typeAndValueArgument.kt"); + } + + @TestMetadata("typeArgumentAndFunctionLiteral.kt") + public void testTypeArgumentAndFunctionLiteral() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/typeArgumentAndFunctionLiteral.kt"); + } + + @TestMetadata("valueAndFunctionLiteralInvoke.kt") + public void testValueAndFunctionLiteralInvoke() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/valueAndFunctionLiteralInvoke.kt"); + } + + @TestMetadata("valueArgumentInvoke.kt") + public void testValueArgumentInvoke() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/valueArgumentInvoke.kt"); + } + + @TestMetadata("varargInvoke.kt") + public void testVarargInvoke() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/varargInvoke.kt"); + } + } - @TestMetadata("functionalArgument.kt") - public void testFunctionalArgument() throws Exception { - doTestReplaceGetIntention("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/functionalArgument.kt"); - } - - @TestMetadata("invalidArgument.kt") - public void testInvalidArgument() throws Exception { - doTestReplaceGetIntention("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/invalidArgument.kt"); - } - - @TestMetadata("missingArgument.kt") - public void testMissingArgument() throws Exception { - doTestReplaceGetIntention("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/missingArgument.kt"); - } - - @TestMetadata("missingDefaultArgument.kt") - public void testMissingDefaultArgument() throws Exception { - doTestReplaceGetIntention("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/missingDefaultArgument.kt"); - } - - @TestMetadata("multiArgument.kt") - public void testMultiArgument() throws Exception { - doTestReplaceGetIntention("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/multiArgument.kt"); - } - - @TestMetadata("namedAndFunction.kt") - public void testNamedAndFunction() throws Exception { - doTestReplaceGetIntention("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/namedAndFunction.kt"); - } - - @TestMetadata("noArgument.kt") - public void testNoArgument() throws Exception { - doTestReplaceGetIntention("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/noArgument.kt"); - } - - @TestMetadata("sanityCheck.kt") - public void testSanityCheck() throws Exception { - doTestReplaceGetIntention("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/sanityCheck.kt"); - } - - @TestMetadata("singleArgument.kt") - public void testSingleArgument() throws Exception { - doTestReplaceGetIntention("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/singleArgument.kt"); - } - - @TestMetadata("singleNamedArgument.kt") - public void testSingleNamedArgument() throws Exception { - doTestReplaceGetIntention("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/singleNamedArgument.kt"); - } - - @TestMetadata("unacceptableVararg.kt") - public void testUnacceptableVararg() throws Exception { - doTestReplaceGetIntention("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/unacceptableVararg.kt"); - } - - @TestMetadata("unnamedAndNamed.kt") - public void testUnnamedAndNamed() throws Exception { - doTestReplaceGetIntention("idea/testData/intentions/attributeCallReplacements/replaceGetIntention/unnamedAndNamed.kt"); + @TestMetadata("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention") + public static class ReplaceUnaryPrefixIntention extends AbstractCodeTransformationTest { + @TestMetadata("acceptableVararg.kt") + public void testAcceptableVararg() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/acceptableVararg.kt"); + } + + public void testAllFilesPresentInReplaceUnaryPrefixIntention() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("complexPlus.kt") + public void testComplexPlus() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/complexPlus.kt"); + } + + @TestMetadata("defaultArgument.kt") + public void testDefaultArgument() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/defaultArgument.kt"); + } + + @TestMetadata("extensionFunction.kt") + public void testExtensionFunction() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/extensionFunction.kt"); + } + + @TestMetadata("functionLiteralArgument.kt") + public void testFunctionLiteralArgument() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/functionLiteralArgument.kt"); + } + + @TestMetadata("minusSanityTest.kt") + public void testMinusSanityTest() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/minusSanityTest.kt"); + } + + @TestMetadata("namedValueArgument.kt") + public void testNamedValueArgument() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/namedValueArgument.kt"); + } + + @TestMetadata("notSanityTest.kt") + public void testNotSanityTest() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/notSanityTest.kt"); + } + + @TestMetadata("plusPlus.kt") + public void testPlusPlus() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/plusPlus.kt"); + } + + @TestMetadata("plusSanityTest.kt") + public void testPlusSanityTest() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/plusSanityTest.kt"); + } + + @TestMetadata("typeArguments.kt") + public void testTypeArguments() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/typeArguments.kt"); + } + + @TestMetadata("unacceptableVararg.kt") + public void testUnacceptableVararg() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/unacceptableVararg.kt"); + } + + @TestMetadata("valueArgument.kt") + public void testValueArgument() throws Exception { + doTest("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/valueArgument.kt"); + } + } public static Test innerSuite() { - TestSuite suite = new TestSuite("ReplaceGetIntention"); - suite.addTestSuite(ReplaceGetIntention.class); + TestSuite suite = new TestSuite("AttributeCallReplacements"); + suite.addTestSuite(AttributeCallReplacements.class); + suite.addTestSuite(ReplaceBinaryInfixIntention.class); + suite.addTestSuite(ReplaceContainsIntention.class); + suite.addTest(ReplaceGetIntention.innerSuite()); + suite.addTestSuite(ReplaceInvokeIntention.class); + suite.addTestSuite(ReplaceUnaryPrefixIntention.class); return suite; } } - @TestMetadata("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention") - public static class ReplaceContainsIntention extends AbstractCodeTransformationTest { - @TestMetadata("acceptableVararg.kt") - public void testAcceptableVararg() throws Exception { - doTestReplaceContainsIntention("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/acceptableVararg.kt"); - } - - @TestMetadata("acceptableVararg2.kt") - public void testAcceptableVararg2() throws Exception { - doTestReplaceContainsIntention("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/acceptableVararg2.kt"); - } - - public void testAllFilesPresentInReplaceContainsIntention() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("allowableDefaultArgument.kt") - public void testAllowableDefaultArgument() throws Exception { - doTestReplaceContainsIntention("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/allowableDefaultArgument.kt"); - } - - @TestMetadata("containsInExpression.kt") - public void testContainsInExpression() throws Exception { - doTestReplaceContainsIntention("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/containsInExpression.kt"); - } - - @TestMetadata("extensionFunction.kt") - public void testExtensionFunction() throws Exception { - doTestReplaceContainsIntention("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/extensionFunction.kt"); - } - - @TestMetadata("functionLiteralArgument.kt") - public void testFunctionLiteralArgument() throws Exception { - doTestReplaceContainsIntention("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/functionLiteralArgument.kt"); - } - - @TestMetadata("functionLiteralArgumentAfterSemicolon.kt") - public void testFunctionLiteralArgumentAfterSemicolon() throws Exception { - doTestReplaceContainsIntention("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/functionLiteralArgumentAfterSemicolon.kt"); - } - - @TestMetadata("functionLiteralArgumentAtStartOfBlock.kt") - public void testFunctionLiteralArgumentAtStartOfBlock() throws Exception { - doTestReplaceContainsIntention("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/functionLiteralArgumentAtStartOfBlock.kt"); - } - - @TestMetadata("functionLiteralArgumentInExpression.kt") - public void testFunctionLiteralArgumentInExpression() throws Exception { - doTestReplaceContainsIntention("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/functionLiteralArgumentInExpression.kt"); - } - - @TestMetadata("invalidArgument.kt") - public void testInvalidArgument() throws Exception { - doTestReplaceContainsIntention("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/invalidArgument.kt"); - } - - @TestMetadata("missingArgument.kt") - public void testMissingArgument() throws Exception { - doTestReplaceContainsIntention("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/missingArgument.kt"); - } - - @TestMetadata("missingDefaultArgument.kt") - public void testMissingDefaultArgument() throws Exception { - doTestReplaceContainsIntention("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/missingDefaultArgument.kt"); - } - - @TestMetadata("multipleArguments.kt") - public void testMultipleArguments() throws Exception { - doTestReplaceContainsIntention("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/multipleArguments.kt"); - } - - @TestMetadata("simpleArgument.kt") - public void testSimpleArgument() throws Exception { - doTestReplaceContainsIntention("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/simpleArgument.kt"); - } - - @TestMetadata("typeArguments.kt") - public void testTypeArguments() throws Exception { - doTestReplaceContainsIntention("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/typeArguments.kt"); - } - - @TestMetadata("unacceptableVararg1.kt") - public void testUnacceptableVararg1() throws Exception { - doTestReplaceContainsIntention("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/unacceptableVararg1.kt"); - } - - @TestMetadata("unacceptableVararg2.kt") - public void testUnacceptableVararg2() throws Exception { - doTestReplaceContainsIntention("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/unacceptableVararg2.kt"); - } - - @TestMetadata("validNamedArgument.kt") - public void testValidNamedArgument() throws Exception { - doTestReplaceContainsIntention("idea/testData/intentions/attributeCallReplacements/replaceContainsIntention/validNamedArgument.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention") - public static class ReplaceBinaryInfixIntention extends AbstractCodeTransformationTest { - @TestMetadata("acceptableVararg1.kt") - public void testAcceptableVararg1() throws Exception { - doTestReplaceBinaryInfixIntention("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/acceptableVararg1.kt"); - } - - @TestMetadata("acceptableVararg2.kt") - public void testAcceptableVararg2() throws Exception { - doTestReplaceBinaryInfixIntention("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/acceptableVararg2.kt"); - } - - public void testAllFilesPresentInReplaceBinaryInfixIntention() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("allowableDefaultArgument.kt") - public void testAllowableDefaultArgument() throws Exception { - doTestReplaceBinaryInfixIntention("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/allowableDefaultArgument.kt"); - } - - @TestMetadata("divSanityTest.kt") - public void testDivSanityTest() throws Exception { - doTestReplaceBinaryInfixIntention("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/divSanityTest.kt"); - } - - @TestMetadata("extensionFunction.kt") - public void testExtensionFunction() throws Exception { - doTestReplaceBinaryInfixIntention("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/extensionFunction.kt"); - } - - @TestMetadata("functionLiteralArgument.kt") - public void testFunctionLiteralArgument() throws Exception { - doTestReplaceBinaryInfixIntention("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/functionLiteralArgument.kt"); - } - - @TestMetadata("minusSanityTest.kt") - public void testMinusSanityTest() throws Exception { - doTestReplaceBinaryInfixIntention("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/minusSanityTest.kt"); - } - - @TestMetadata("missingDefaultArgument.kt") - public void testMissingDefaultArgument() throws Exception { - doTestReplaceBinaryInfixIntention("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/missingDefaultArgument.kt"); - } - - @TestMetadata("modSanityTest.kt") - public void testModSanityTest() throws Exception { - doTestReplaceBinaryInfixIntention("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/modSanityTest.kt"); - } - - @TestMetadata("multipleArguments.kt") - public void testMultipleArguments() throws Exception { - doTestReplaceBinaryInfixIntention("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/multipleArguments.kt"); - } - - @TestMetadata("plusSanityTest.kt") - public void testPlusSanityTest() throws Exception { - doTestReplaceBinaryInfixIntention("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/plusSanityTest.kt"); - } - - @TestMetadata("rangeToSanityTest.kt") - public void testRangeToSanityTest() throws Exception { - doTestReplaceBinaryInfixIntention("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/rangeToSanityTest.kt"); - } - - @TestMetadata("timesSanityTest.kt") - public void testTimesSanityTest() throws Exception { - doTestReplaceBinaryInfixIntention("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/timesSanityTest.kt"); - } - - @TestMetadata("typeArguments.kt") - public void testTypeArguments() throws Exception { - doTestReplaceBinaryInfixIntention("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/typeArguments.kt"); - } - - @TestMetadata("unacceptableVararg1.kt") - public void testUnacceptableVararg1() throws Exception { - doTestReplaceBinaryInfixIntention("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/unacceptableVararg1.kt"); - } - - @TestMetadata("unacceptableVararg2.kt") - public void testUnacceptableVararg2() throws Exception { - doTestReplaceBinaryInfixIntention("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/unacceptableVararg2.kt"); - } - - @TestMetadata("validNamedArgument.kt") - public void testValidNamedArgument() throws Exception { - doTestReplaceBinaryInfixIntention("idea/testData/intentions/attributeCallReplacements/replaceBinaryInfixIntention/validNamedArgument.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention") - public static class ReplaceUnaryPrefixIntention extends AbstractCodeTransformationTest { - @TestMetadata("acceptableVararg.kt") - public void testAcceptableVararg() throws Exception { - doTestReplaceUnaryPrefixIntention("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/acceptableVararg.kt"); - } - - public void testAllFilesPresentInReplaceUnaryPrefixIntention() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("complexPlus.kt") - public void testComplexPlus() throws Exception { - doTestReplaceUnaryPrefixIntention("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/complexPlus.kt"); - } - - @TestMetadata("defaultArgument.kt") - public void testDefaultArgument() throws Exception { - doTestReplaceUnaryPrefixIntention("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/defaultArgument.kt"); - } - - @TestMetadata("extensionFunction.kt") - public void testExtensionFunction() throws Exception { - doTestReplaceUnaryPrefixIntention("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/extensionFunction.kt"); - } - - @TestMetadata("functionLiteralArgument.kt") - public void testFunctionLiteralArgument() throws Exception { - doTestReplaceUnaryPrefixIntention("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/functionLiteralArgument.kt"); - } - - @TestMetadata("minusSanityTest.kt") - public void testMinusSanityTest() throws Exception { - doTestReplaceUnaryPrefixIntention("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/minusSanityTest.kt"); - } - - @TestMetadata("namedValueArgument.kt") - public void testNamedValueArgument() throws Exception { - doTestReplaceUnaryPrefixIntention("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/namedValueArgument.kt"); - } - - @TestMetadata("notSanityTest.kt") - public void testNotSanityTest() throws Exception { - doTestReplaceUnaryPrefixIntention("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/notSanityTest.kt"); - } - - @TestMetadata("plusPlus.kt") - public void testPlusPlus() throws Exception { - doTestReplaceUnaryPrefixIntention("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/plusPlus.kt"); - } - - @TestMetadata("plusSanityTest.kt") - public void testPlusSanityTest() throws Exception { - doTestReplaceUnaryPrefixIntention("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/plusSanityTest.kt"); - } - - @TestMetadata("typeArguments.kt") - public void testTypeArguments() throws Exception { - doTestReplaceUnaryPrefixIntention("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/typeArguments.kt"); - } - - @TestMetadata("unacceptableVararg.kt") - public void testUnacceptableVararg() throws Exception { - doTestReplaceUnaryPrefixIntention("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/unacceptableVararg.kt"); - } - - @TestMetadata("valueArgument.kt") - public void testValueArgument() throws Exception { - doTestReplaceUnaryPrefixIntention("idea/testData/intentions/attributeCallReplacements/replaceUnaryPrefixIntention/valueArgument.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention") - public static class ReplaceInvokeIntention extends AbstractCodeTransformationTest { - public void testAllFilesPresentInReplaceInvokeIntention() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("extensionFunction.kt") - public void testExtensionFunction() throws Exception { - doTestReplaceInvokeIntention("idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/extensionFunction.kt"); - } - - @TestMetadata("functionLiteralInvoke.kt") - public void testFunctionLiteralInvoke() throws Exception { - doTestReplaceInvokeIntention("idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/functionLiteralInvoke.kt"); - } - - @TestMetadata("invokeInExpression.kt") - public void testInvokeInExpression() throws Exception { - doTestReplaceInvokeIntention("idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/invokeInExpression.kt"); - } - - @TestMetadata("namedArgumentInvoke.kt") - public void testNamedArgumentInvoke() throws Exception { - doTestReplaceInvokeIntention("idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/namedArgumentInvoke.kt"); - } - - @TestMetadata("noArgumentInvoke.kt") - public void testNoArgumentInvoke() throws Exception { - doTestReplaceInvokeIntention("idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/noArgumentInvoke.kt"); - } - - @TestMetadata("typeAndValueArgument.kt") - public void testTypeAndValueArgument() throws Exception { - doTestReplaceInvokeIntention("idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/typeAndValueArgument.kt"); - } - - @TestMetadata("typeArgumentAndFunctionLiteral.kt") - public void testTypeArgumentAndFunctionLiteral() throws Exception { - doTestReplaceInvokeIntention("idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/typeArgumentAndFunctionLiteral.kt"); - } - - @TestMetadata("valueAndFunctionLiteralInvoke.kt") - public void testValueAndFunctionLiteralInvoke() throws Exception { - doTestReplaceInvokeIntention("idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/valueAndFunctionLiteralInvoke.kt"); - } - - @TestMetadata("valueArgumentInvoke.kt") - public void testValueArgumentInvoke() throws Exception { - doTestReplaceInvokeIntention("idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/valueArgumentInvoke.kt"); - } - - @TestMetadata("varargInvoke.kt") - public void testVarargInvoke() throws Exception { - doTestReplaceInvokeIntention("idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/varargInvoke.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention") - @InnerTestClasses({}) - public static class SimplifyNegatedBinaryExpressionIntention extends AbstractCodeTransformationTest { - public void testAllFilesPresentInSimplifyNegatedBinaryExpressionIntention() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("equals.kt") - public void testEquals() throws Exception { - doTestSimplifyNegatedBinaryExpressionIntention("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/equals.kt"); - } - - @TestMetadata("greaterThan.kt") - public void testGreaterThan() throws Exception { - doTestSimplifyNegatedBinaryExpressionIntention("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/greaterThan.kt"); - } - - @TestMetadata("greaterThanOrEquals.kt") - public void testGreaterThanOrEquals() throws Exception { - doTestSimplifyNegatedBinaryExpressionIntention("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/greaterThanOrEquals.kt"); - } - - @TestMetadata("in.kt") - public void testIn() throws Exception { - doTestSimplifyNegatedBinaryExpressionIntention("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/in.kt"); - } - - @TestMetadata("inapplicableBinaryOperation.kt") - public void testInapplicableBinaryOperation() throws Exception { - doTestSimplifyNegatedBinaryExpressionIntention("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/inapplicableBinaryOperation.kt"); - } - - @TestMetadata("is.kt") - public void testIs() throws Exception { - doTestSimplifyNegatedBinaryExpressionIntention("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/is.kt"); - } - - @TestMetadata("lessThan.kt") - public void testLessThan() throws Exception { - doTestSimplifyNegatedBinaryExpressionIntention("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/lessThan.kt"); - } - - @TestMetadata("lessThanOrEquals.kt") - public void testLessThanOrEquals() throws Exception { - doTestSimplifyNegatedBinaryExpressionIntention("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/lessThanOrEquals.kt"); - } - - @TestMetadata("notEquals.kt") - public void testNotEquals() throws Exception { - doTestSimplifyNegatedBinaryExpressionIntention("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/notEquals.kt"); - } - - @TestMetadata("notIn.kt") - public void testNotIn() throws Exception { - doTestSimplifyNegatedBinaryExpressionIntention("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/notIn.kt"); - } - - @TestMetadata("notIs.kt") - public void testNotIs() throws Exception { - doTestSimplifyNegatedBinaryExpressionIntention("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/notIs.kt"); - } - - @TestMetadata("simpleInvert.kt") - public void testSimpleInvert() throws Exception { - doTestSimplifyNegatedBinaryExpressionIntention("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/simpleInvert.kt"); + @TestMetadata("idea/testData/intentions/branched") + @InnerTestClasses({Branched.DoubleBangToIfThen.class, Branched.ElvisToIfThen.class, Branched.Folding.class, Branched.IfThenToDoubleBang.class, Branched.IfThenToElvis.class, Branched.IfThenToSafeAccess.class, Branched.IfWhen.class, Branched.SafeAccessToIfThen.class, Branched.Unfolding.class, Branched.When.class}) + public static class Branched extends AbstractCodeTransformationTest { + public void testAllFilesPresentInBranched() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("idea/testData/intentions/branched/doubleBangToIfThen") + public static class DoubleBangToIfThen extends AbstractCodeTransformationTest { + public void testAllFilesPresentInDoubleBangToIfThen() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/doubleBangToIfThen"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("callExpression.kt") + public void testCallExpression() throws Exception { + doTest("idea/testData/intentions/branched/doubleBangToIfThen/callExpression.kt"); + } + + @TestMetadata("callExpressionParens.kt") + public void testCallExpressionParens() throws Exception { + doTest("idea/testData/intentions/branched/doubleBangToIfThen/callExpressionParens.kt"); + } + + @TestMetadata("exceptionTextEscapesQuotes.kt") + public void testExceptionTextEscapesQuotes() throws Exception { + doTest("idea/testData/intentions/branched/doubleBangToIfThen/exceptionTextEscapesQuotes.kt"); + } + + @TestMetadata("exceptionTextHandlesMultiline.kt") + public void testExceptionTextHandlesMultiline() throws Exception { + doTest("idea/testData/intentions/branched/doubleBangToIfThen/exceptionTextHandlesMultiline.kt"); + } + + @TestMetadata("localVal.kt") + public void testLocalVal() throws Exception { + doTest("idea/testData/intentions/branched/doubleBangToIfThen/localVal.kt"); + } + + @TestMetadata("localVar.kt") + public void testLocalVar() throws Exception { + doTest("idea/testData/intentions/branched/doubleBangToIfThen/localVar.kt"); + } + + @TestMetadata("simpleNameExpressionInParens.kt") + public void testSimpleNameExpressionInParens() throws Exception { + doTest("idea/testData/intentions/branched/doubleBangToIfThen/simpleNameExpressionInParens.kt"); + } + + @TestMetadata("topLevelVal.kt") + public void testTopLevelVal() throws Exception { + doTest("idea/testData/intentions/branched/doubleBangToIfThen/topLevelVal.kt"); + } + + @TestMetadata("topLevelValCustomGetter.kt") + public void testTopLevelValCustomGetter() throws Exception { + doTest("idea/testData/intentions/branched/doubleBangToIfThen/topLevelValCustomGetter.kt"); + } + + @TestMetadata("topLevelVar.kt") + public void testTopLevelVar() throws Exception { + doTest("idea/testData/intentions/branched/doubleBangToIfThen/topLevelVar.kt"); + } + + @TestMetadata("topLevelVarCustomGetter.kt") + public void testTopLevelVarCustomGetter() throws Exception { + doTest("idea/testData/intentions/branched/doubleBangToIfThen/topLevelVarCustomGetter.kt"); + } + + @TestMetadata("usedInAssignment.kt") + public void testUsedInAssignment() throws Exception { + doTest("idea/testData/intentions/branched/doubleBangToIfThen/usedInAssignment.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/branched/elvisToIfThen") + public static class ElvisToIfThen extends AbstractCodeTransformationTest { + public void testAllFilesPresentInElvisToIfThen() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/elvisToIfThen"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("callExpression.kt") + public void testCallExpression() throws Exception { + doTest("idea/testData/intentions/branched/elvisToIfThen/callExpression.kt"); + } + + @TestMetadata("callExpressionParens.kt") + public void testCallExpressionParens() throws Exception { + doTest("idea/testData/intentions/branched/elvisToIfThen/callExpressionParens.kt"); + } + + @TestMetadata("elvisAsExpression.kt") + public void testElvisAsExpression() throws Exception { + doTest("idea/testData/intentions/branched/elvisToIfThen/elvisAsExpression.kt"); + } + + @TestMetadata("localValLhs.kt") + public void testLocalValLhs() throws Exception { + doTest("idea/testData/intentions/branched/elvisToIfThen/localValLhs.kt"); + } + + @TestMetadata("localVarLhs.kt") + public void testLocalVarLhs() throws Exception { + doTest("idea/testData/intentions/branched/elvisToIfThen/localVarLhs.kt"); + } + + @TestMetadata("simpleNameExpression.kt") + public void testSimpleNameExpression() throws Exception { + doTest("idea/testData/intentions/branched/elvisToIfThen/simpleNameExpression.kt"); + } + + @TestMetadata("simpleNameExpressionInParens.kt") + public void testSimpleNameExpressionInParens() throws Exception { + doTest("idea/testData/intentions/branched/elvisToIfThen/simpleNameExpressionInParens.kt"); + } + + @TestMetadata("topLevelVal.kt") + public void testTopLevelVal() throws Exception { + doTest("idea/testData/intentions/branched/elvisToIfThen/topLevelVal.kt"); + } + + @TestMetadata("topLevelValCustomGetter.kt") + public void testTopLevelValCustomGetter() throws Exception { + doTest("idea/testData/intentions/branched/elvisToIfThen/topLevelValCustomGetter.kt"); + } + + @TestMetadata("topLevelVar.kt") + public void testTopLevelVar() throws Exception { + doTest("idea/testData/intentions/branched/elvisToIfThen/topLevelVar.kt"); + } + + @TestMetadata("topLevelVarCustomGetter.kt") + public void testTopLevelVarCustomGetter() throws Exception { + doTest("idea/testData/intentions/branched/elvisToIfThen/topLevelVarCustomGetter.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/branched/folding") + @InnerTestClasses({Folding.IfToAssignment.class, Folding.IfToReturn.class, Folding.IfToReturnAsymmetrically.class, Folding.WhenToAssignment.class, Folding.WhenToReturn.class}) + public static class Folding extends AbstractCodeTransformationTest { + public void testAllFilesPresentInFolding() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/folding"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("idea/testData/intentions/branched/folding/ifToAssignment") + public static class IfToAssignment extends AbstractCodeTransformationTest { + public void testAllFilesPresentInIfToAssignment() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/folding/ifToAssignment"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("innerIfTransformed.kt") + public void testInnerIfTransformed() throws Exception { + doTest("idea/testData/intentions/branched/folding/ifToAssignment/innerIfTransformed.kt"); + } + + @TestMetadata("simpleIf.kt") + public void testSimpleIf() throws Exception { + doTest("idea/testData/intentions/branched/folding/ifToAssignment/simpleIf.kt"); + } + + @TestMetadata("simpleIfWithAugmentedAssignment.kt") + public void testSimpleIfWithAugmentedAssignment() throws Exception { + doTest("idea/testData/intentions/branched/folding/ifToAssignment/simpleIfWithAugmentedAssignment.kt"); + } + + @TestMetadata("simpleIfWithBlocks.kt") + public void testSimpleIfWithBlocks() throws Exception { + doTest("idea/testData/intentions/branched/folding/ifToAssignment/simpleIfWithBlocks.kt"); + } + + @TestMetadata("simpleIfWithShadowedVar.kt") + public void testSimpleIfWithShadowedVar() throws Exception { + doTest("idea/testData/intentions/branched/folding/ifToAssignment/simpleIfWithShadowedVar.kt"); + } + + @TestMetadata("simpleIfWithUnmatchedAssignmentOps.kt") + public void testSimpleIfWithUnmatchedAssignmentOps() throws Exception { + doTest("idea/testData/intentions/branched/folding/ifToAssignment/simpleIfWithUnmatchedAssignmentOps.kt"); + } + + @TestMetadata("simpleIfWithUnmatchedAssignments.kt") + public void testSimpleIfWithUnmatchedAssignments() throws Exception { + doTest("idea/testData/intentions/branched/folding/ifToAssignment/simpleIfWithUnmatchedAssignments.kt"); + } + + @TestMetadata("simpleIfWithoutElse.kt") + public void testSimpleIfWithoutElse() throws Exception { + doTest("idea/testData/intentions/branched/folding/ifToAssignment/simpleIfWithoutElse.kt"); + } + + @TestMetadata("simpleIfWithoutTerminatingAssignment.kt") + public void testSimpleIfWithoutTerminatingAssignment() throws Exception { + doTest("idea/testData/intentions/branched/folding/ifToAssignment/simpleIfWithoutTerminatingAssignment.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/branched/folding/ifToReturn") + public static class IfToReturn extends AbstractCodeTransformationTest { + public void testAllFilesPresentInIfToReturn() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/folding/ifToReturn"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("innerIfTransformed.kt") + public void testInnerIfTransformed() throws Exception { + doTest("idea/testData/intentions/branched/folding/ifToReturn/innerIfTransformed.kt"); + } + + @TestMetadata("simpleIf.kt") + public void testSimpleIf() throws Exception { + doTest("idea/testData/intentions/branched/folding/ifToReturn/simpleIf.kt"); + } + + @TestMetadata("simpleIfWithBlocks.kt") + public void testSimpleIfWithBlocks() throws Exception { + doTest("idea/testData/intentions/branched/folding/ifToReturn/simpleIfWithBlocks.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/branched/folding/ifToReturnAsymmetrically") + public static class IfToReturnAsymmetrically extends AbstractCodeTransformationTest { + public void testAllFilesPresentInIfToReturnAsymmetrically() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/folding/ifToReturnAsymmetrically"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("simpleIf.kt") + public void testSimpleIf() throws Exception { + doTest("idea/testData/intentions/branched/folding/ifToReturnAsymmetrically/simpleIf.kt"); + } + + @TestMetadata("simpleIfWithBlocks.kt") + public void testSimpleIfWithBlocks() throws Exception { + doTest("idea/testData/intentions/branched/folding/ifToReturnAsymmetrically/simpleIfWithBlocks.kt"); + } + + @TestMetadata("simpleIfWithComments.kt") + public void testSimpleIfWithComments() throws Exception { + doTest("idea/testData/intentions/branched/folding/ifToReturnAsymmetrically/simpleIfWithComments.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/branched/folding/whenToAssignment") + public static class WhenToAssignment extends AbstractCodeTransformationTest { + public void testAllFilesPresentInWhenToAssignment() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/folding/whenToAssignment"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("innerWhenTransformed.kt") + public void testInnerWhenTransformed() throws Exception { + doTest("idea/testData/intentions/branched/folding/whenToAssignment/innerWhenTransformed.kt"); + } + + @TestMetadata("simpleWhen.kt") + public void testSimpleWhen() throws Exception { + doTest("idea/testData/intentions/branched/folding/whenToAssignment/simpleWhen.kt"); + } + + @TestMetadata("simpleWhenWithBlocks.kt") + public void testSimpleWhenWithBlocks() throws Exception { + doTest("idea/testData/intentions/branched/folding/whenToAssignment/simpleWhenWithBlocks.kt"); + } + + @TestMetadata("simpleWhenWithShadowedVar.kt") + public void testSimpleWhenWithShadowedVar() throws Exception { + doTest("idea/testData/intentions/branched/folding/whenToAssignment/simpleWhenWithShadowedVar.kt"); + } + + @TestMetadata("simpleWhenWithUnmatchedAssignments.kt") + public void testSimpleWhenWithUnmatchedAssignments() throws Exception { + doTest("idea/testData/intentions/branched/folding/whenToAssignment/simpleWhenWithUnmatchedAssignments.kt"); + } + + @TestMetadata("simpleWhenWithoutTerminatingAssignment.kt") + public void testSimpleWhenWithoutTerminatingAssignment() throws Exception { + doTest("idea/testData/intentions/branched/folding/whenToAssignment/simpleWhenWithoutTerminatingAssignment.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/branched/folding/whenToReturn") + public static class WhenToReturn extends AbstractCodeTransformationTest { + public void testAllFilesPresentInWhenToReturn() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/folding/whenToReturn"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("innerWhenTransformed.kt") + public void testInnerWhenTransformed() throws Exception { + doTest("idea/testData/intentions/branched/folding/whenToReturn/innerWhenTransformed.kt"); + } + + @TestMetadata("simpleWhen.kt") + public void testSimpleWhen() throws Exception { + doTest("idea/testData/intentions/branched/folding/whenToReturn/simpleWhen.kt"); + } + + @TestMetadata("simpleWhenWithBlocks.kt") + public void testSimpleWhenWithBlocks() throws Exception { + doTest("idea/testData/intentions/branched/folding/whenToReturn/simpleWhenWithBlocks.kt"); + } + + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("Folding"); + suite.addTestSuite(Folding.class); + suite.addTestSuite(IfToAssignment.class); + suite.addTestSuite(IfToReturn.class); + suite.addTestSuite(IfToReturnAsymmetrically.class); + suite.addTestSuite(WhenToAssignment.class); + suite.addTestSuite(WhenToReturn.class); + return suite; + } + } + + @TestMetadata("idea/testData/intentions/branched/ifThenToDoubleBang") + public static class IfThenToDoubleBang extends AbstractCodeTransformationTest { + @TestMetadata("acceptableEmptyElseBlockForStatement.kt") + public void testAcceptableEmptyElseBlockForStatement() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/acceptableEmptyElseBlockForStatement.kt"); + } + + @TestMetadata("acceptableEmptyThenBlockForStatement.kt") + public void testAcceptableEmptyThenBlockForStatement() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/acceptableEmptyThenBlockForStatement.kt"); + } + + @TestMetadata("acceptableWithoutElseBlockForStatementWithFun.kt") + public void testAcceptableWithoutElseBlockForStatementWithFun() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/acceptableWithoutElseBlockForStatementWithFun.kt"); + } + + @TestMetadata("acceptableWithoutElseBlockForStatementWithVal.kt") + public void testAcceptableWithoutElseBlockForStatementWithVal() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/acceptableWithoutElseBlockForStatementWithVal.kt"); + } + + public void testAllFilesPresentInIfThenToDoubleBang() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/ifThenToDoubleBang"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("blockHasMoreThanOneStatement.kt") + public void testBlockHasMoreThanOneStatement() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/blockHasMoreThanOneStatement.kt"); + } + + @TestMetadata("blockUsesDifferentVar.kt") + public void testBlockUsesDifferentVar() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/blockUsesDifferentVar.kt"); + } + + @TestMetadata("conditionComparesNullWithNull.kt") + public void testConditionComparesNullWithNull() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/conditionComparesNullWithNull.kt"); + } + + @TestMetadata("conditionInvalidBinaryExp.kt") + public void testConditionInvalidBinaryExp() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/conditionInvalidBinaryExp.kt"); + } + + @TestMetadata("conditionNotBinaryExpr.kt") + public void testConditionNotBinaryExpr() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/conditionNotBinaryExpr.kt"); + } + + @TestMetadata("doesNotinlineValueIfUsedMoreThanOnce.kt") + public void testDoesNotinlineValueIfUsedMoreThanOnce() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/doesNotinlineValueIfUsedMoreThanOnce.kt"); + } + + @TestMetadata("doesNotinlineValueOutsideOfScope.kt") + public void testDoesNotinlineValueOutsideOfScope() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/doesNotinlineValueOutsideOfScope.kt"); + } + + @TestMetadata("emptyCondition.kt") + public void testEmptyCondition() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/emptyCondition.kt"); + } + + @TestMetadata("emptyElseBlock.kt") + public void testEmptyElseBlock() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/emptyElseBlock.kt"); + } + + @TestMetadata("emptyThenBlock.kt") + public void testEmptyThenBlock() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/emptyThenBlock.kt"); + } + + @TestMetadata("ifAndElseBothInBlocks.kt") + public void testIfAndElseBothInBlocks() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/ifAndElseBothInBlocks.kt"); + } + + @TestMetadata("ifAndElseNotInBlocks.kt") + public void testIfAndElseNotInBlocks() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/ifAndElseNotInBlocks.kt"); + } + + @TestMetadata("ifAsExpression.kt") + public void testIfAsExpression() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/ifAsExpression.kt"); + } + + @TestMetadata("lhsEqualsNull.kt") + public void testLhsEqualsNull() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/lhsEqualsNull.kt"); + } + + @TestMetadata("lhsNotEqualsNull.kt") + public void testLhsNotEqualsNull() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/lhsNotEqualsNull.kt"); + } + + @TestMetadata("missingElseClause.kt") + public void testMissingElseClause() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/missingElseClause.kt"); + } + + @TestMetadata("missingThenClause.kt") + public void testMissingThenClause() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/missingThenClause.kt"); + } + + @TestMetadata("noCondition.kt") + public void testNoCondition() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/noCondition.kt"); + } + + @TestMetadata("noNullInCondition.kt") + public void testNoNullInCondition() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/noNullInCondition.kt"); + } + + @TestMetadata("notApplicableForFunction.kt") + public void testNotApplicableForFunction() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/notApplicableForFunction.kt"); + } + + @TestMetadata("notApplicableForLocalVar.kt") + public void testNotApplicableForLocalVar() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/notApplicableForLocalVar.kt"); + } + + @TestMetadata("nullBranchAlsoNull.kt") + public void testNullBranchAlsoNull() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/nullBranchAlsoNull.kt"); + } + + @TestMetadata("otherBlockHasMoreThanOneStatement.kt") + public void testOtherBlockHasMoreThanOneStatement() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/otherBlockHasMoreThanOneStatement.kt"); + } + + @TestMetadata("rhsEqualsNull.kt") + public void testRhsEqualsNull() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/rhsEqualsNull.kt"); + } + + @TestMetadata("rhsNotEqualsNull.kt") + public void testRhsNotEqualsNull() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/rhsNotEqualsNull.kt"); + } + + @TestMetadata("thenAndElseBothNull.kt") + public void testThenAndElseBothNull() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/thenAndElseBothNull.kt"); + } + + @TestMetadata("throwByFqName.kt") + public void testThrowByFqName() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/throwByFqName.kt"); + } + + @TestMetadata("unacceptableEmptyElseBlockForExpression.kt") + public void testUnacceptableEmptyElseBlockForExpression() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/unacceptableEmptyElseBlockForExpression.kt"); + } + + @TestMetadata("unacceptableEmptyThenBlockForExpression.kt") + public void testUnacceptableEmptyThenBlockForExpression() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/unacceptableEmptyThenBlockForExpression.kt"); + } + + @TestMetadata("willNotInlineClassProperty.kt") + public void testWillNotInlineClassProperty() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToDoubleBang/willNotInlineClassProperty.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/branched/ifThenToElvis") + @InnerTestClasses({}) + public static class IfThenToElvis extends AbstractCodeTransformationTest { + public void testAllFilesPresentInIfThenToElvis() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/ifThenToElvis"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("blockHasMoreThanOneStatement.kt") + public void testBlockHasMoreThanOneStatement() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/blockHasMoreThanOneStatement.kt"); + } + + @TestMetadata("blockUsesDifferentVar.kt") + public void testBlockUsesDifferentVar() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/blockUsesDifferentVar.kt"); + } + + @TestMetadata("conditionComparesNullWithNull.kt") + public void testConditionComparesNullWithNull() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/conditionComparesNullWithNull.kt"); + } + + @TestMetadata("conditionInvalidBinaryExp.kt") + public void testConditionInvalidBinaryExp() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/conditionInvalidBinaryExp.kt"); + } + + @TestMetadata("conditionNotBinaryExpr.kt") + public void testConditionNotBinaryExpr() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/conditionNotBinaryExpr.kt"); + } + + @TestMetadata("doesNotinlineValueIfUsedMoreThanOnce.kt") + public void testDoesNotinlineValueIfUsedMoreThanOnce() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/doesNotinlineValueIfUsedMoreThanOnce.kt"); + } + + @TestMetadata("doesNotinlineValueOutsideOfScope.kt") + public void testDoesNotinlineValueOutsideOfScope() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/doesNotinlineValueOutsideOfScope.kt"); + } + + @TestMetadata("emptyCondition.kt") + public void testEmptyCondition() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/emptyCondition.kt"); + } + + @TestMetadata("emptyElseBlock.kt") + public void testEmptyElseBlock() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/emptyElseBlock.kt"); + } + + @TestMetadata("emptyThenBlock.kt") + public void testEmptyThenBlock() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/emptyThenBlock.kt"); + } + + @TestMetadata("ifAndElseBothInBlocks.kt") + public void testIfAndElseBothInBlocks() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/ifAndElseBothInBlocks.kt"); + } + + @TestMetadata("ifAndElseNotInBlocks.kt") + public void testIfAndElseNotInBlocks() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/ifAndElseNotInBlocks.kt"); + } + + @TestMetadata("ifAsExpression.kt") + public void testIfAsExpression() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/ifAsExpression.kt"); + } + + @TestMetadata("ifAsPartOfExpression.kt") + public void testIfAsPartOfExpression() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/ifAsPartOfExpression.kt"); + } + + @TestMetadata("lhsEqualsNull.kt") + public void testLhsEqualsNull() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/lhsEqualsNull.kt"); + } + + @TestMetadata("lhsNotEqualsNull.kt") + public void testLhsNotEqualsNull() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/lhsNotEqualsNull.kt"); + } + + @TestMetadata("missingElseClause.kt") + public void testMissingElseClause() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/missingElseClause.kt"); + } + + @TestMetadata("missingThenClause.kt") + public void testMissingThenClause() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/missingThenClause.kt"); + } + + @TestMetadata("noCondition.kt") + public void testNoCondition() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/noCondition.kt"); + } + + @TestMetadata("noNullInCondition.kt") + public void testNoNullInCondition() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/noNullInCondition.kt"); + } + + @TestMetadata("notApplicableForFunction.kt") + public void testNotApplicableForFunction() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/notApplicableForFunction.kt"); + } + + @TestMetadata("notApplicableForLocalVar.kt") + public void testNotApplicableForLocalVar() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/notApplicableForLocalVar.kt"); + } + + @TestMetadata("notApplicableForSimpleKotlinNPE.kt") + public void testNotApplicableForSimpleKotlinNPE() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/notApplicableForSimpleKotlinNPE.kt"); + } + + @TestMetadata("notApplicableForSimpleNPE.kt") + public void testNotApplicableForSimpleNPE() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/notApplicableForSimpleNPE.kt"); + } + + @TestMetadata("nullBranchAlsoNull.kt") + public void testNullBranchAlsoNull() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/nullBranchAlsoNull.kt"); + } + + @TestMetadata("otherBlockHasMoreThanOneStatement.kt") + public void testOtherBlockHasMoreThanOneStatement() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/otherBlockHasMoreThanOneStatement.kt"); + } + + @TestMetadata("rhsEqualsNull.kt") + public void testRhsEqualsNull() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/rhsEqualsNull.kt"); + } + + @TestMetadata("rhsNotEqualsNull.kt") + public void testRhsNotEqualsNull() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/rhsNotEqualsNull.kt"); + } + + @TestMetadata("thenAndElseBothNull.kt") + public void testThenAndElseBothNull() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/thenAndElseBothNull.kt"); + } + + @TestMetadata("throwsNPEwithArgument.kt") + public void testThrowsNPEwithArgument() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/throwsNPEwithArgument.kt"); + } + + @TestMetadata("willNotInlineClassProperty.kt") + public void testWillNotInlineClassProperty() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToElvis/willNotInlineClassProperty.kt"); + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("IfThenToElvis"); + suite.addTestSuite(IfThenToElvis.class); + return suite; + } + } + + @TestMetadata("idea/testData/intentions/branched/ifThenToSafeAccess") + @InnerTestClasses({}) + public static class IfThenToSafeAccess extends AbstractCodeTransformationTest { + public void testAllFilesPresentInIfThenToSafeAccess() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/ifThenToSafeAccess"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("blockHasMoreThanOneStatement.kt") + public void testBlockHasMoreThanOneStatement() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/blockHasMoreThanOneStatement.kt"); + } + + @TestMetadata("blockUsesDifferentVar.kt") + public void testBlockUsesDifferentVar() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/blockUsesDifferentVar.kt"); + } + + @TestMetadata("conditionComparesNullWithNull.kt") + public void testConditionComparesNullWithNull() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/conditionComparesNullWithNull.kt"); + } + + @TestMetadata("conditionInvalidBinaryExp.kt") + public void testConditionInvalidBinaryExp() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/conditionInvalidBinaryExp.kt"); + } + + @TestMetadata("conditionNotBinaryExpr.kt") + public void testConditionNotBinaryExpr() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/conditionNotBinaryExpr.kt"); + } + + @TestMetadata("doesNotinlineValueIfUsedMoreThanOnce.kt") + public void testDoesNotinlineValueIfUsedMoreThanOnce() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/doesNotinlineValueIfUsedMoreThanOnce.kt"); + } + + @TestMetadata("doesNotinlineValueOutsideOfScope.kt") + public void testDoesNotinlineValueOutsideOfScope() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/doesNotinlineValueOutsideOfScope.kt"); + } + + @TestMetadata("emptyCondition.kt") + public void testEmptyCondition() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/emptyCondition.kt"); + } + + @TestMetadata("emptyElseBlock.kt") + public void testEmptyElseBlock() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/emptyElseBlock.kt"); + } + + @TestMetadata("emptyThenBlock.kt") + public void testEmptyThenBlock() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/emptyThenBlock.kt"); + } + + @TestMetadata("ifAndElseBothInBlocks.kt") + public void testIfAndElseBothInBlocks() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/ifAndElseBothInBlocks.kt"); + } + + @TestMetadata("ifAndElseNotInBlocks.kt") + public void testIfAndElseNotInBlocks() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/ifAndElseNotInBlocks.kt"); + } + + @TestMetadata("ifAsExpression.kt") + public void testIfAsExpression() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/ifAsExpression.kt"); + } + + @TestMetadata("lhsEqualsNull.kt") + public void testLhsEqualsNull() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/lhsEqualsNull.kt"); + } + + @TestMetadata("lhsNotEqualsNull.kt") + public void testLhsNotEqualsNull() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/lhsNotEqualsNull.kt"); + } + + @TestMetadata("missingNecessaryElseClause.kt") + public void testMissingNecessaryElseClause() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/missingNecessaryElseClause.kt"); + } + + @TestMetadata("missingNecessaryThenClause.kt") + public void testMissingNecessaryThenClause() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/missingNecessaryThenClause.kt"); + } + + @TestMetadata("noCondition.kt") + public void testNoCondition() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/noCondition.kt"); + } + + @TestMetadata("noElseBlock.kt") + public void testNoElseBlock() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/noElseBlock.kt"); + } + + @TestMetadata("noNullInCondition.kt") + public void testNoNullInCondition() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/noNullInCondition.kt"); + } + + @TestMetadata("noNullInCondition2.kt") + public void testNoNullInCondition2() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/noNullInCondition2.kt"); + } + + @TestMetadata("noThenBlock.kt") + public void testNoThenBlock() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/noThenBlock.kt"); + } + + @TestMetadata("notApplicableForFunction.kt") + public void testNotApplicableForFunction() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/notApplicableForFunction.kt"); + } + + @TestMetadata("notApplicableForLocalVar.kt") + public void testNotApplicableForLocalVar() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/notApplicableForLocalVar.kt"); + } + + @TestMetadata("otherBlockHasMoreThanOneStatement.kt") + public void testOtherBlockHasMoreThanOneStatement() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/otherBlockHasMoreThanOneStatement.kt"); + } + + @TestMetadata("rhsEqualsNull.kt") + public void testRhsEqualsNull() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/rhsEqualsNull.kt"); + } + + @TestMetadata("rhsNotEqualsNull.kt") + public void testRhsNotEqualsNull() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/rhsNotEqualsNull.kt"); + } + + @TestMetadata("thenAndElseBothNull.kt") + public void testThenAndElseBothNull() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/thenAndElseBothNull.kt"); + } + + @TestMetadata("thenAndElseNotNull.kt") + public void testThenAndElseNotNull() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/thenAndElseNotNull.kt"); + } + + @TestMetadata("unacceptableEmptyElseBlock.kt") + public void testUnacceptableEmptyElseBlock() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/unacceptableEmptyElseBlock.kt"); + } + + @TestMetadata("unacceptableEmptyThenBlock.kt") + public void testUnacceptableEmptyThenBlock() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/unacceptableEmptyThenBlock.kt"); + } + + @TestMetadata("unacceptableNoElseBlock.kt") + public void testUnacceptableNoElseBlock() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/unacceptableNoElseBlock.kt"); + } + + @TestMetadata("unacceptableNoThenBlock.kt") + public void testUnacceptableNoThenBlock() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/unacceptableNoThenBlock.kt"); + } + + @TestMetadata("willNotInlineClassProperty.kt") + public void testWillNotInlineClassProperty() throws Exception { + doTest("idea/testData/intentions/branched/ifThenToSafeAccess/willNotInlineClassProperty.kt"); + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("IfThenToSafeAccess"); + suite.addTestSuite(IfThenToSafeAccess.class); + return suite; + } + } + + @TestMetadata("idea/testData/intentions/branched/ifWhen") + @InnerTestClasses({IfWhen.IfToWhen.class, IfWhen.WhenToIf.class}) + public static class IfWhen extends AbstractCodeTransformationTest { + public void testAllFilesPresentInIfWhen() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/ifWhen"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("idea/testData/intentions/branched/ifWhen/ifToWhen") + public static class IfToWhen extends AbstractCodeTransformationTest { + public void testAllFilesPresentInIfToWhen() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/ifWhen/ifToWhen"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("ifWithEqualityTests.kt") + public void testIfWithEqualityTests() throws Exception { + doTest("idea/testData/intentions/branched/ifWhen/ifToWhen/ifWithEqualityTests.kt"); + } + + @TestMetadata("ifWithIs.kt") + public void testIfWithIs() throws Exception { + doTest("idea/testData/intentions/branched/ifWhen/ifToWhen/ifWithIs.kt"); + } + + @TestMetadata("ifWithMultiConditions.kt") + public void testIfWithMultiConditions() throws Exception { + doTest("idea/testData/intentions/branched/ifWhen/ifToWhen/ifWithMultiConditions.kt"); + } + + @TestMetadata("ifWithNegativeIs.kt") + public void testIfWithNegativeIs() throws Exception { + doTest("idea/testData/intentions/branched/ifWhen/ifToWhen/ifWithNegativeIs.kt"); + } + + @TestMetadata("ifWithNegativeRangeTests.kt") + public void testIfWithNegativeRangeTests() throws Exception { + doTest("idea/testData/intentions/branched/ifWhen/ifToWhen/ifWithNegativeRangeTests.kt"); + } + + @TestMetadata("ifWithRangeTests.kt") + public void testIfWithRangeTests() throws Exception { + doTest("idea/testData/intentions/branched/ifWhen/ifToWhen/ifWithRangeTests.kt"); + } + + @TestMetadata("ifWithRangeTestsAndMultiConditions.kt") + public void testIfWithRangeTestsAndMultiConditions() throws Exception { + doTest("idea/testData/intentions/branched/ifWhen/ifToWhen/ifWithRangeTestsAndMultiConditions.kt"); + } + + @TestMetadata("ifWithRangeTestsAndUnparenthesizedMultiConditions.kt") + public void testIfWithRangeTestsAndUnparenthesizedMultiConditions() throws Exception { + doTest("idea/testData/intentions/branched/ifWhen/ifToWhen/ifWithRangeTestsAndUnparenthesizedMultiConditions.kt"); + } + + @TestMetadata("ifWithoutElse.kt") + public void testIfWithoutElse() throws Exception { + doTest("idea/testData/intentions/branched/ifWhen/ifToWhen/ifWithoutElse.kt"); + } + + @TestMetadata("whenWithMultipleConditionTypes.kt") + public void testWhenWithMultipleConditionTypes() throws Exception { + doTest("idea/testData/intentions/branched/ifWhen/ifToWhen/whenWithMultipleConditionTypes.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/branched/ifWhen/whenToIf") + public static class WhenToIf extends AbstractCodeTransformationTest { + public void testAllFilesPresentInWhenToIf() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/ifWhen/whenToIf"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("whenWithDotQualifiedExpression.kt") + public void testWhenWithDotQualifiedExpression() throws Exception { + doTest("idea/testData/intentions/branched/ifWhen/whenToIf/whenWithDotQualifiedExpression.kt"); + } + + @TestMetadata("whenWithEqualityTests.kt") + public void testWhenWithEqualityTests() throws Exception { + doTest("idea/testData/intentions/branched/ifWhen/whenToIf/whenWithEqualityTests.kt"); + } + + @TestMetadata("whenWithMultiConditions.kt") + public void testWhenWithMultiConditions() throws Exception { + doTest("idea/testData/intentions/branched/ifWhen/whenToIf/whenWithMultiConditions.kt"); + } + + @TestMetadata("whenWithMultipleConditionTypes.kt") + public void testWhenWithMultipleConditionTypes() throws Exception { + doTest("idea/testData/intentions/branched/ifWhen/whenToIf/whenWithMultipleConditionTypes.kt"); + } + + @TestMetadata("whenWithNegativePatterns.kt") + public void testWhenWithNegativePatterns() throws Exception { + doTest("idea/testData/intentions/branched/ifWhen/whenToIf/whenWithNegativePatterns.kt"); + } + + @TestMetadata("whenWithNegativeRangeTests.kt") + public void testWhenWithNegativeRangeTests() throws Exception { + doTest("idea/testData/intentions/branched/ifWhen/whenToIf/whenWithNegativeRangeTests.kt"); + } + + @TestMetadata("whenWithPatterns.kt") + public void testWhenWithPatterns() throws Exception { + doTest("idea/testData/intentions/branched/ifWhen/whenToIf/whenWithPatterns.kt"); + } + + @TestMetadata("whenWithRangeTests.kt") + public void testWhenWithRangeTests() throws Exception { + doTest("idea/testData/intentions/branched/ifWhen/whenToIf/whenWithRangeTests.kt"); + } + + @TestMetadata("whenWithRangeTestsAndMultiConditions.kt") + public void testWhenWithRangeTestsAndMultiConditions() throws Exception { + doTest("idea/testData/intentions/branched/ifWhen/whenToIf/whenWithRangeTestsAndMultiConditions.kt"); + } + + @TestMetadata("whenWithoutElse.kt") + public void testWhenWithoutElse() throws Exception { + doTest("idea/testData/intentions/branched/ifWhen/whenToIf/whenWithoutElse.kt"); + } + + @TestMetadata("whenWithoutSubject.kt") + public void testWhenWithoutSubject() throws Exception { + doTest("idea/testData/intentions/branched/ifWhen/whenToIf/whenWithoutSubject.kt"); + } + + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("IfWhen"); + suite.addTestSuite(IfWhen.class); + suite.addTestSuite(IfToWhen.class); + suite.addTestSuite(WhenToIf.class); + return suite; + } + } + + @TestMetadata("idea/testData/intentions/branched/safeAccessToIfThen") + public static class SafeAccessToIfThen extends AbstractCodeTransformationTest { + public void testAllFilesPresentInSafeAccessToIfThen() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/safeAccessToIfThen"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("binaryExpressionLhs.kt") + public void testBinaryExpressionLhs() throws Exception { + doTest("idea/testData/intentions/branched/safeAccessToIfThen/binaryExpressionLhs.kt"); + } + + @TestMetadata("callExpression.kt") + public void testCallExpression() throws Exception { + doTest("idea/testData/intentions/branched/safeAccessToIfThen/callExpression.kt"); + } + + @TestMetadata("callExpressionParens.kt") + public void testCallExpressionParens() throws Exception { + doTest("idea/testData/intentions/branched/safeAccessToIfThen/callExpressionParens.kt"); + } + + @TestMetadata("customGetterAsReceiver.kt") + public void testCustomGetterAsReceiver() throws Exception { + doTest("idea/testData/intentions/branched/safeAccessToIfThen/customGetterAsReceiver.kt"); + } + + @TestMetadata("localValAsReceiver.kt") + public void testLocalValAsReceiver() throws Exception { + doTest("idea/testData/intentions/branched/safeAccessToIfThen/localValAsReceiver.kt"); + } + + @TestMetadata("localValLhs.kt") + public void testLocalValLhs() throws Exception { + doTest("idea/testData/intentions/branched/safeAccessToIfThen/localValLhs.kt"); + } + + @TestMetadata("localVarLhs.kt") + public void testLocalVarLhs() throws Exception { + doTest("idea/testData/intentions/branched/safeAccessToIfThen/localVarLhs.kt"); + } + + @TestMetadata("resultAssignedToLocalVal.kt") + public void testResultAssignedToLocalVal() throws Exception { + doTest("idea/testData/intentions/branched/safeAccessToIfThen/resultAssignedToLocalVal.kt"); + } + + @TestMetadata("safeAccessAsFunctionArgument.kt") + public void testSafeAccessAsFunctionArgument() throws Exception { + doTest("idea/testData/intentions/branched/safeAccessToIfThen/safeAccessAsFunctionArgument.kt"); + } + + @TestMetadata("simpleNameExpression.kt") + public void testSimpleNameExpression() throws Exception { + doTest("idea/testData/intentions/branched/safeAccessToIfThen/simpleNameExpression.kt"); + } + + @TestMetadata("simpleNameExpressionInParens.kt") + public void testSimpleNameExpressionInParens() throws Exception { + doTest("idea/testData/intentions/branched/safeAccessToIfThen/simpleNameExpressionInParens.kt"); + } + + @TestMetadata("simplePropertyAsReceiver.kt") + public void testSimplePropertyAsReceiver() throws Exception { + doTest("idea/testData/intentions/branched/safeAccessToIfThen/simplePropertyAsReceiver.kt"); + } + + @TestMetadata("simplePropertyAsReceiver2.kt") + public void testSimplePropertyAsReceiver2() throws Exception { + doTest("idea/testData/intentions/branched/safeAccessToIfThen/simplePropertyAsReceiver2.kt"); + } + + @TestMetadata("simplePropertyAsReceiver3.kt") + public void testSimplePropertyAsReceiver3() throws Exception { + doTest("idea/testData/intentions/branched/safeAccessToIfThen/simplePropertyAsReceiver3.kt"); + } + + @TestMetadata("topLevelVal.kt") + public void testTopLevelVal() throws Exception { + doTest("idea/testData/intentions/branched/safeAccessToIfThen/topLevelVal.kt"); + } + + @TestMetadata("topLevelValCustomGetter.kt") + public void testTopLevelValCustomGetter() throws Exception { + doTest("idea/testData/intentions/branched/safeAccessToIfThen/topLevelValCustomGetter.kt"); + } + + @TestMetadata("topLevelVar.kt") + public void testTopLevelVar() throws Exception { + doTest("idea/testData/intentions/branched/safeAccessToIfThen/topLevelVar.kt"); + } + + @TestMetadata("topLevelVarCustomGetter.kt") + public void testTopLevelVarCustomGetter() throws Exception { + doTest("idea/testData/intentions/branched/safeAccessToIfThen/topLevelVarCustomGetter.kt"); + } + + @TestMetadata("usedAsFunctionRhs.kt") + public void testUsedAsFunctionRhs() throws Exception { + doTest("idea/testData/intentions/branched/safeAccessToIfThen/usedAsFunctionRhs.kt"); + } + + @TestMetadata("usedAsResultOfCheckedIf.kt") + public void testUsedAsResultOfCheckedIf() throws Exception { + doTest("idea/testData/intentions/branched/safeAccessToIfThen/usedAsResultOfCheckedIf.kt"); + } + + @TestMetadata("usedAsReturnValue.kt") + public void testUsedAsReturnValue() throws Exception { + doTest("idea/testData/intentions/branched/safeAccessToIfThen/usedAsReturnValue.kt"); + } + + @TestMetadata("usedInUncheckedIfExpression.kt") + public void testUsedInUncheckedIfExpression() throws Exception { + doTest("idea/testData/intentions/branched/safeAccessToIfThen/usedInUncheckedIfExpression.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/branched/unfolding") + @InnerTestClasses({Unfolding.AssignmentToIf.class, Unfolding.AssignmentToWhen.class, Unfolding.PropertyToIf.class, Unfolding.PropertyToWhen.class, Unfolding.ReturnToIf.class, Unfolding.ReturnToWhen.class}) + public static class Unfolding extends AbstractCodeTransformationTest { + public void testAllFilesPresentInUnfolding() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/unfolding"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("idea/testData/intentions/branched/unfolding/assignmentToIf") + public static class AssignmentToIf extends AbstractCodeTransformationTest { + public void testAllFilesPresentInAssignmentToIf() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/unfolding/assignmentToIf"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("innerIfTransformed.kt") + public void testInnerIfTransformed() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/assignmentToIf/innerIfTransformed.kt"); + } + + @TestMetadata("nestedIfs.kt") + public void testNestedIfs() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/assignmentToIf/nestedIfs.kt"); + } + + @TestMetadata("simpleIf.kt") + public void testSimpleIf() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/assignmentToIf/simpleIf.kt"); + } + + @TestMetadata("simpleIfWithAugmentedAssignment.kt") + public void testSimpleIfWithAugmentedAssignment() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/assignmentToIf/simpleIfWithAugmentedAssignment.kt"); + } + + @TestMetadata("simpleIfWithBlocks.kt") + public void testSimpleIfWithBlocks() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/assignmentToIf/simpleIfWithBlocks.kt"); + } + + @TestMetadata("simpleIfWithComplexAssignmentLHS.kt") + public void testSimpleIfWithComplexAssignmentLHS() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/assignmentToIf/simpleIfWithComplexAssignmentLHS.kt"); + } + + @TestMetadata("simpleIfWithoutAssignment.kt") + public void testSimpleIfWithoutAssignment() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/assignmentToIf/simpleIfWithoutAssignment.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/branched/unfolding/assignmentToWhen") + public static class AssignmentToWhen extends AbstractCodeTransformationTest { + public void testAllFilesPresentInAssignmentToWhen() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/unfolding/assignmentToWhen"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("innerWhenTransformed.kt") + public void testInnerWhenTransformed() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/assignmentToWhen/innerWhenTransformed.kt"); + } + + @TestMetadata("simpleWhen.kt") + public void testSimpleWhen() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/assignmentToWhen/simpleWhen.kt"); + } + + @TestMetadata("simpleWhenWithBlocks.kt") + public void testSimpleWhenWithBlocks() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/assignmentToWhen/simpleWhenWithBlocks.kt"); + } + + @TestMetadata("simpleWhenWithComplexAssignmentLHS.kt") + public void testSimpleWhenWithComplexAssignmentLHS() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/assignmentToWhen/simpleWhenWithComplexAssignmentLHS.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/branched/unfolding/propertyToIf") + public static class PropertyToIf extends AbstractCodeTransformationTest { + public void testAllFilesPresentInPropertyToIf() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/unfolding/propertyToIf"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("nestedIfs.kt") + public void testNestedIfs() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/propertyToIf/nestedIfs.kt"); + } + + @TestMetadata("nestedIfs2.kt") + public void testNestedIfs2() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/propertyToIf/nestedIfs2.kt"); + } + + @TestMetadata("nonLocalProperty.kt") + public void testNonLocalProperty() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/propertyToIf/nonLocalProperty.kt"); + } + + @TestMetadata("nonLocalProperty2.kt") + public void testNonLocalProperty2() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/propertyToIf/nonLocalProperty2.kt"); + } + + @TestMetadata("simpleIf.kt") + public void testSimpleIf() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/propertyToIf/simpleIf.kt"); + } + + @TestMetadata("simpleIf2.kt") + public void testSimpleIf2() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/propertyToIf/simpleIf2.kt"); + } + + @TestMetadata("simpleIfWithBlocks.kt") + public void testSimpleIfWithBlocks() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/propertyToIf/simpleIfWithBlocks.kt"); + } + + @TestMetadata("simpleIfWithBlocks2.kt") + public void testSimpleIfWithBlocks2() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/propertyToIf/simpleIfWithBlocks2.kt"); + } + + @TestMetadata("simpleIfWithType.kt") + public void testSimpleIfWithType() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/propertyToIf/simpleIfWithType.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/branched/unfolding/propertyToWhen") + public static class PropertyToWhen extends AbstractCodeTransformationTest { + public void testAllFilesPresentInPropertyToWhen() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/unfolding/propertyToWhen"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("nonLocalProperty.kt") + public void testNonLocalProperty() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/propertyToWhen/nonLocalProperty.kt"); + } + + @TestMetadata("nonLocalProperty2.kt") + public void testNonLocalProperty2() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/propertyToWhen/nonLocalProperty2.kt"); + } + + @TestMetadata("simpleWhen.kt") + public void testSimpleWhen() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/propertyToWhen/simpleWhen.kt"); + } + + @TestMetadata("simpleWhen2.kt") + public void testSimpleWhen2() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/propertyToWhen/simpleWhen2.kt"); + } + + @TestMetadata("simpleWhenWithBlocks.kt") + public void testSimpleWhenWithBlocks() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/propertyToWhen/simpleWhenWithBlocks.kt"); + } + + @TestMetadata("simpleWhenWithBlocks2.kt") + public void testSimpleWhenWithBlocks2() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/propertyToWhen/simpleWhenWithBlocks2.kt"); + } + + @TestMetadata("simpleWhenWithType.kt") + public void testSimpleWhenWithType() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/propertyToWhen/simpleWhenWithType.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/branched/unfolding/returnToIf") + public static class ReturnToIf extends AbstractCodeTransformationTest { + public void testAllFilesPresentInReturnToIf() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/unfolding/returnToIf"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("innerIfTransformed.kt") + public void testInnerIfTransformed() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/returnToIf/innerIfTransformed.kt"); + } + + @TestMetadata("simpleIf.kt") + public void testSimpleIf() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/returnToIf/simpleIf.kt"); + } + + @TestMetadata("simpleIfWithBlocks.kt") + public void testSimpleIfWithBlocks() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/returnToIf/simpleIfWithBlocks.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/branched/unfolding/returnToWhen") + public static class ReturnToWhen extends AbstractCodeTransformationTest { + public void testAllFilesPresentInReturnToWhen() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/unfolding/returnToWhen"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("innerWhenTransformed.kt") + public void testInnerWhenTransformed() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/returnToWhen/innerWhenTransformed.kt"); + } + + @TestMetadata("simpleWhen.kt") + public void testSimpleWhen() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/returnToWhen/simpleWhen.kt"); + } + + @TestMetadata("simpleWhenWithBlocks.kt") + public void testSimpleWhenWithBlocks() throws Exception { + doTest("idea/testData/intentions/branched/unfolding/returnToWhen/simpleWhenWithBlocks.kt"); + } + + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("Unfolding"); + suite.addTestSuite(Unfolding.class); + suite.addTestSuite(AssignmentToIf.class); + suite.addTestSuite(AssignmentToWhen.class); + suite.addTestSuite(PropertyToIf.class); + suite.addTestSuite(PropertyToWhen.class); + suite.addTestSuite(ReturnToIf.class); + suite.addTestSuite(ReturnToWhen.class); + return suite; + } + } + + @TestMetadata("idea/testData/intentions/branched/when") + @InnerTestClasses({When.EliminateSubject.class, When.Flatten.class, When.IntroduceSubject.class, When.Merge.class}) + public static class When extends AbstractCodeTransformationTest { + public void testAllFilesPresentInWhen() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/when"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("idea/testData/intentions/branched/when/eliminateSubject") + public static class EliminateSubject extends AbstractCodeTransformationTest { + public void testAllFilesPresentInEliminateSubject() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/when/eliminateSubject"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("whenWithEqualityTests.kt") + public void testWhenWithEqualityTests() throws Exception { + doTest("idea/testData/intentions/branched/when/eliminateSubject/whenWithEqualityTests.kt"); + } + + @TestMetadata("whenWithMultipleConditionTypes.kt") + public void testWhenWithMultipleConditionTypes() throws Exception { + doTest("idea/testData/intentions/branched/when/eliminateSubject/whenWithMultipleConditionTypes.kt"); + } + + @TestMetadata("whenWithNegativePatterns.kt") + public void testWhenWithNegativePatterns() throws Exception { + doTest("idea/testData/intentions/branched/when/eliminateSubject/whenWithNegativePatterns.kt"); + } + + @TestMetadata("whenWithNegativeRangeTests.kt") + public void testWhenWithNegativeRangeTests() throws Exception { + doTest("idea/testData/intentions/branched/when/eliminateSubject/whenWithNegativeRangeTests.kt"); + } + + @TestMetadata("whenWithPatterns.kt") + public void testWhenWithPatterns() throws Exception { + doTest("idea/testData/intentions/branched/when/eliminateSubject/whenWithPatterns.kt"); + } + + @TestMetadata("whenWithRangeTests.kt") + public void testWhenWithRangeTests() throws Exception { + doTest("idea/testData/intentions/branched/when/eliminateSubject/whenWithRangeTests.kt"); + } + + @TestMetadata("whenWithRangeTestsAndMultiConditions.kt") + public void testWhenWithRangeTestsAndMultiConditions() throws Exception { + doTest("idea/testData/intentions/branched/when/eliminateSubject/whenWithRangeTestsAndMultiConditions.kt"); + } + + @TestMetadata("whenWithoutSubject.kt") + public void testWhenWithoutSubject() throws Exception { + doTest("idea/testData/intentions/branched/when/eliminateSubject/whenWithoutSubject.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/branched/when/flatten") + public static class Flatten extends AbstractCodeTransformationTest { + public void testAllFilesPresentInFlatten() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/when/flatten"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("flattenWithSubject.kt") + public void testFlattenWithSubject() throws Exception { + doTest("idea/testData/intentions/branched/when/flatten/flattenWithSubject.kt"); + } + + @TestMetadata("flattenWithUnmatchedSubjects.kt") + public void testFlattenWithUnmatchedSubjects() throws Exception { + doTest("idea/testData/intentions/branched/when/flatten/flattenWithUnmatchedSubjects.kt"); + } + + @TestMetadata("flattenWithoutSubject.kt") + public void testFlattenWithoutSubject() throws Exception { + doTest("idea/testData/intentions/branched/when/flatten/flattenWithoutSubject.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/branched/when/introduceSubject") + public static class IntroduceSubject extends AbstractCodeTransformationTest { + public void testAllFilesPresentInIntroduceSubject() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/when/introduceSubject"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("whenWithEqualityTests.kt") + public void testWhenWithEqualityTests() throws Exception { + doTest("idea/testData/intentions/branched/when/introduceSubject/whenWithEqualityTests.kt"); + } + + @TestMetadata("whenWithMultipleConditionTypes.kt") + public void testWhenWithMultipleConditionTypes() throws Exception { + doTest("idea/testData/intentions/branched/when/introduceSubject/whenWithMultipleConditionTypes.kt"); + } + + @TestMetadata("whenWithNegativePatterns.kt") + public void testWhenWithNegativePatterns() throws Exception { + doTest("idea/testData/intentions/branched/when/introduceSubject/whenWithNegativePatterns.kt"); + } + + @TestMetadata("whenWithNegativeRangeTests.kt") + public void testWhenWithNegativeRangeTests() throws Exception { + doTest("idea/testData/intentions/branched/when/introduceSubject/whenWithNegativeRangeTests.kt"); + } + + @TestMetadata("whenWithNondivisibleConditions.kt") + public void testWhenWithNondivisibleConditions() throws Exception { + doTest("idea/testData/intentions/branched/when/introduceSubject/whenWithNondivisibleConditions.kt"); + } + + @TestMetadata("whenWithPatterns.kt") + public void testWhenWithPatterns() throws Exception { + doTest("idea/testData/intentions/branched/when/introduceSubject/whenWithPatterns.kt"); + } + + @TestMetadata("whenWithRangeTests.kt") + public void testWhenWithRangeTests() throws Exception { + doTest("idea/testData/intentions/branched/when/introduceSubject/whenWithRangeTests.kt"); + } + + @TestMetadata("whenWithRangeTestsAndMultiConditions.kt") + public void testWhenWithRangeTestsAndMultiConditions() throws Exception { + doTest("idea/testData/intentions/branched/when/introduceSubject/whenWithRangeTestsAndMultiConditions.kt"); + } + + @TestMetadata("whenWithSubject.kt") + public void testWhenWithSubject() throws Exception { + doTest("idea/testData/intentions/branched/when/introduceSubject/whenWithSubject.kt"); + } + + @TestMetadata("whenWithSwappedEqualityTests.kt") + public void testWhenWithSwappedEqualityTests() throws Exception { + doTest("idea/testData/intentions/branched/when/introduceSubject/whenWithSwappedEqualityTests.kt"); + } + + @TestMetadata("whenWithUnmatchedCandidateSubjects.kt") + public void testWhenWithUnmatchedCandidateSubjects() throws Exception { + doTest("idea/testData/intentions/branched/when/introduceSubject/whenWithUnmatchedCandidateSubjects.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/branched/when/merge") + public static class Merge extends AbstractCodeTransformationTest { + public void testAllFilesPresentInMerge() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/branched/when/merge"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("mergeBlockWithBlock.kt") + public void testMergeBlockWithBlock() throws Exception { + doTest("idea/testData/intentions/branched/when/merge/mergeBlockWithBlock.kt"); + } + + @TestMetadata("mergeBlockWithSingle.kt") + public void testMergeBlockWithSingle() throws Exception { + doTest("idea/testData/intentions/branched/when/merge/mergeBlockWithSingle.kt"); + } + + @TestMetadata("mergeWithConflictingDeclarations.kt") + public void testMergeWithConflictingDeclarations() throws Exception { + doTest("idea/testData/intentions/branched/when/merge/mergeWithConflictingDeclarations.kt"); + } + + @TestMetadata("mergeWithDeclarations.kt") + public void testMergeWithDeclarations() throws Exception { + doTest("idea/testData/intentions/branched/when/merge/mergeWithDeclarations.kt"); + } + + @TestMetadata("mergeWithReturnAfter.kt") + public void testMergeWithReturnAfter() throws Exception { + doTest("idea/testData/intentions/branched/when/merge/mergeWithReturnAfter.kt"); + } + + @TestMetadata("mergeWithReturnBefore.kt") + public void testMergeWithReturnBefore() throws Exception { + doTest("idea/testData/intentions/branched/when/merge/mergeWithReturnBefore.kt"); + } + + @TestMetadata("mergeWithSubject.kt") + public void testMergeWithSubject() throws Exception { + doTest("idea/testData/intentions/branched/when/merge/mergeWithSubject.kt"); + } + + @TestMetadata("mergeWithUnmatchedConditions1.kt") + public void testMergeWithUnmatchedConditions1() throws Exception { + doTest("idea/testData/intentions/branched/when/merge/mergeWithUnmatchedConditions1.kt"); + } + + @TestMetadata("mergeWithUnmatchedConditions2.kt") + public void testMergeWithUnmatchedConditions2() throws Exception { + doTest("idea/testData/intentions/branched/when/merge/mergeWithUnmatchedConditions2.kt"); + } + + @TestMetadata("mergeWithUnmatchedConditions3.kt") + public void testMergeWithUnmatchedConditions3() throws Exception { + doTest("idea/testData/intentions/branched/when/merge/mergeWithUnmatchedConditions3.kt"); + } + + @TestMetadata("mergeWithUnmatchedConditions4.kt") + public void testMergeWithUnmatchedConditions4() throws Exception { + doTest("idea/testData/intentions/branched/when/merge/mergeWithUnmatchedConditions4.kt"); + } + + @TestMetadata("mergeWithUnmatchedConditions5.kt") + public void testMergeWithUnmatchedConditions5() throws Exception { + doTest("idea/testData/intentions/branched/when/merge/mergeWithUnmatchedConditions5.kt"); + } + + @TestMetadata("mergeWithUnmatchedConditions6.kt") + public void testMergeWithUnmatchedConditions6() throws Exception { + doTest("idea/testData/intentions/branched/when/merge/mergeWithUnmatchedConditions6.kt"); + } + + @TestMetadata("mergeWithUnmatchedConditions7.kt") + public void testMergeWithUnmatchedConditions7() throws Exception { + doTest("idea/testData/intentions/branched/when/merge/mergeWithUnmatchedConditions7.kt"); + } + + @TestMetadata("mergeWithUnmatchedSubjects1.kt") + public void testMergeWithUnmatchedSubjects1() throws Exception { + doTest("idea/testData/intentions/branched/when/merge/mergeWithUnmatchedSubjects1.kt"); + } + + @TestMetadata("mergeWithUnmatchedSubjects2.kt") + public void testMergeWithUnmatchedSubjects2() throws Exception { + doTest("idea/testData/intentions/branched/when/merge/mergeWithUnmatchedSubjects2.kt"); + } + + @TestMetadata("mergeWithoutSubject.kt") + public void testMergeWithoutSubject() throws Exception { + doTest("idea/testData/intentions/branched/when/merge/mergeWithoutSubject.kt"); + } + + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("When"); + suite.addTestSuite(When.class); + suite.addTestSuite(EliminateSubject.class); + suite.addTestSuite(Flatten.class); + suite.addTestSuite(IntroduceSubject.class); + suite.addTestSuite(Merge.class); + return suite; + } } public static Test innerSuite() { - TestSuite suite = new TestSuite("SimplifyNegatedBinaryExpressionIntention"); - suite.addTestSuite(SimplifyNegatedBinaryExpressionIntention.class); + TestSuite suite = new TestSuite("Branched"); + suite.addTestSuite(Branched.class); + suite.addTestSuite(DoubleBangToIfThen.class); + suite.addTestSuite(ElvisToIfThen.class); + suite.addTest(Folding.innerSuite()); + suite.addTestSuite(IfThenToDoubleBang.class); + suite.addTest(IfThenToElvis.innerSuite()); + suite.addTest(IfThenToSafeAccess.innerSuite()); + suite.addTest(IfWhen.innerSuite()); + suite.addTestSuite(SafeAccessToIfThen.class); + suite.addTest(Unfolding.innerSuite()); + suite.addTest(When.innerSuite()); return suite; } } + @TestMetadata("idea/testData/intentions/convertAssertToIf") + public static class ConvertAssertToIf extends AbstractCodeTransformationTest { + public void testAllFilesPresentInConvertAssertToIf() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/convertAssertToIf"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("assertErrorOverloaded.kt") + public void testAssertErrorOverloaded() throws Exception { + doTest("idea/testData/intentions/convertAssertToIf/assertErrorOverloaded.kt"); + } + + @TestMetadata("booleanCondition.kt") + public void testBooleanCondition() throws Exception { + doTest("idea/testData/intentions/convertAssertToIf/booleanCondition.kt"); + } + + @TestMetadata("booleanConditionSimplified.kt") + public void testBooleanConditionSimplified() throws Exception { + doTest("idea/testData/intentions/convertAssertToIf/booleanConditionSimplified.kt"); + } + + @TestMetadata("booleanConditionSimplified2.kt") + public void testBooleanConditionSimplified2() throws Exception { + doTest("idea/testData/intentions/convertAssertToIf/booleanConditionSimplified2.kt"); + } + + @TestMetadata("booleanConditionWithVariables.kt") + public void testBooleanConditionWithVariables() throws Exception { + doTest("idea/testData/intentions/convertAssertToIf/booleanConditionWithVariables.kt"); + } + + @TestMetadata("dotQualifiedCall.kt") + public void testDotQualifiedCall() throws Exception { + doTest("idea/testData/intentions/convertAssertToIf/dotQualifiedCall.kt"); + } + + @TestMetadata("functionCallCondition.kt") + public void testFunctionCallCondition() throws Exception { + doTest("idea/testData/intentions/convertAssertToIf/functionCallCondition.kt"); + } + + @TestMetadata("functionMessageInsideParentheses.kt") + public void testFunctionMessageInsideParentheses() throws Exception { + doTest("idea/testData/intentions/convertAssertToIf/functionMessageInsideParentheses.kt"); + } + + @TestMetadata("inapplicableAssertOverloaded.kt") + public void testInapplicableAssertOverloaded() throws Exception { + doTest("idea/testData/intentions/convertAssertToIf/inapplicableAssertOverloaded.kt"); + } + + @TestMetadata("inapplicableAssertOverloadedWithPackage.kt") + public void testInapplicableAssertOverloadedWithPackage() throws Exception { + doTest("idea/testData/intentions/convertAssertToIf/inapplicableAssertOverloadedWithPackage.kt"); + } + + @TestMetadata("inapplicableNoCondition.kt") + public void testInapplicableNoCondition() throws Exception { + doTest("idea/testData/intentions/convertAssertToIf/inapplicableNoCondition.kt"); + } + + @TestMetadata("lambdaMessageInsideParentheses.kt") + public void testLambdaMessageInsideParentheses() throws Exception { + doTest("idea/testData/intentions/convertAssertToIf/lambdaMessageInsideParentheses.kt"); + } + + @TestMetadata("lambdaMessageOutsideParentheses.kt") + public void testLambdaMessageOutsideParentheses() throws Exception { + doTest("idea/testData/intentions/convertAssertToIf/lambdaMessageOutsideParentheses.kt"); + } + + @TestMetadata("lambdaVariable.kt") + public void testLambdaVariable() throws Exception { + doTest("idea/testData/intentions/convertAssertToIf/lambdaVariable.kt"); + } + + @TestMetadata("noMessage.kt") + public void testNoMessage() throws Exception { + doTest("idea/testData/intentions/convertAssertToIf/noMessage.kt"); + } + + @TestMetadata("parenthesizedCondition.kt") + public void testParenthesizedCondition() throws Exception { + doTest("idea/testData/intentions/convertAssertToIf/parenthesizedCondition.kt"); + } + + @TestMetadata("simpleConvert.kt") + public void testSimpleConvert() throws Exception { + doTest("idea/testData/intentions/convertAssertToIf/simpleConvert.kt"); + } + + @TestMetadata("stringVariable.kt") + public void testStringVariable() throws Exception { + doTest("idea/testData/intentions/convertAssertToIf/stringVariable.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/convertIfToAssert") + public static class ConvertIfToAssert extends AbstractCodeTransformationTest { + public void testAllFilesPresentInConvertIfToAssert() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/convertIfToAssert"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("assertOverloaded.kt") + public void testAssertOverloaded() throws Exception { + doTest("idea/testData/intentions/convertIfToAssert/assertOverloaded.kt"); + } + + @TestMetadata("assertOverloaded2.kt") + public void testAssertOverloaded2() throws Exception { + doTest("idea/testData/intentions/convertIfToAssert/assertOverloaded2.kt"); + } + + @TestMetadata("booleanCondition.kt") + public void testBooleanCondition() throws Exception { + doTest("idea/testData/intentions/convertIfToAssert/booleanCondition.kt"); + } + + @TestMetadata("dotQualifiedThrow.kt") + public void testDotQualifiedThrow() throws Exception { + doTest("idea/testData/intentions/convertIfToAssert/dotQualifiedThrow.kt"); + } + + @TestMetadata("inapplicableAssertionErrorOverloaded.kt") + public void testInapplicableAssertionErrorOverloaded() throws Exception { + doTest("idea/testData/intentions/convertIfToAssert/inapplicableAssertionErrorOverloaded.kt"); + } + + @TestMetadata("inapplicableCauseSent.kt") + public void testInapplicableCauseSent() throws Exception { + doTest("idea/testData/intentions/convertIfToAssert/inapplicableCauseSent.kt"); + } + + @TestMetadata("inapplicableHasElse.kt") + public void testInapplicableHasElse() throws Exception { + doTest("idea/testData/intentions/convertIfToAssert/inapplicableHasElse.kt"); + } + + @TestMetadata("inapplicableMoreThanSingleExpression.kt") + public void testInapplicableMoreThanSingleExpression() throws Exception { + doTest("idea/testData/intentions/convertIfToAssert/inapplicableMoreThanSingleExpression.kt"); + } + + @TestMetadata("inapplicableMoreThanSingleExpression2.kt") + public void testInapplicableMoreThanSingleExpression2() throws Exception { + doTest("idea/testData/intentions/convertIfToAssert/inapplicableMoreThanSingleExpression2.kt"); + } + + @TestMetadata("noMessageSent.kt") + public void testNoMessageSent() throws Exception { + doTest("idea/testData/intentions/convertIfToAssert/noMessageSent.kt"); + } + + @TestMetadata("nullSent.kt") + public void testNullSent() throws Exception { + doTest("idea/testData/intentions/convertIfToAssert/nullSent.kt"); + } + + @TestMetadata("simpleConvert.kt") + public void testSimpleConvert() throws Exception { + doTest("idea/testData/intentions/convertIfToAssert/simpleConvert.kt"); + } + + @TestMetadata("simplifiedCondition.kt") + public void testSimplifiedCondition() throws Exception { + doTest("idea/testData/intentions/convertIfToAssert/simplifiedCondition.kt"); + } + + } + @TestMetadata("idea/testData/intentions/convertNegatedBooleanSequence") public static class ConvertNegatedBooleanSequence extends AbstractCodeTransformationTest { public void testAllFilesPresentInConvertNegatedBooleanSequence() throws Exception { @@ -3206,52 +2297,52 @@ public class CodeTransformationTestGenerated extends AbstractCodeTransformationT @TestMetadata("complexNegatedSequence.kt") public void testComplexNegatedSequence() throws Exception { - doTestConvertNegatedBooleanSequence("idea/testData/intentions/convertNegatedBooleanSequence/complexNegatedSequence.kt"); + doTest("idea/testData/intentions/convertNegatedBooleanSequence/complexNegatedSequence.kt"); } @TestMetadata("conjunctionOfThreeNegations.kt") public void testConjunctionOfThreeNegations() throws Exception { - doTestConvertNegatedBooleanSequence("idea/testData/intentions/convertNegatedBooleanSequence/conjunctionOfThreeNegations.kt"); + doTest("idea/testData/intentions/convertNegatedBooleanSequence/conjunctionOfThreeNegations.kt"); } @TestMetadata("conjunctionOfTwoNegations.kt") public void testConjunctionOfTwoNegations() throws Exception { - doTestConvertNegatedBooleanSequence("idea/testData/intentions/convertNegatedBooleanSequence/conjunctionOfTwoNegations.kt"); + doTest("idea/testData/intentions/convertNegatedBooleanSequence/conjunctionOfTwoNegations.kt"); } @TestMetadata("disjunctionOfTwoNegations.kt") public void testDisjunctionOfTwoNegations() throws Exception { - doTestConvertNegatedBooleanSequence("idea/testData/intentions/convertNegatedBooleanSequence/disjunctionOfTwoNegations.kt"); + doTest("idea/testData/intentions/convertNegatedBooleanSequence/disjunctionOfTwoNegations.kt"); } @TestMetadata("doubleParenthesizedExpression.kt") public void testDoubleParenthesizedExpression() throws Exception { - doTestConvertNegatedBooleanSequence("idea/testData/intentions/convertNegatedBooleanSequence/doubleParenthesizedExpression.kt"); + doTest("idea/testData/intentions/convertNegatedBooleanSequence/doubleParenthesizedExpression.kt"); } @TestMetadata("inapplicableMixedOperators.kt") public void testInapplicableMixedOperators() throws Exception { - doTestConvertNegatedBooleanSequence("idea/testData/intentions/convertNegatedBooleanSequence/inapplicableMixedOperators.kt"); + doTest("idea/testData/intentions/convertNegatedBooleanSequence/inapplicableMixedOperators.kt"); } @TestMetadata("inapplicableMixedSequence.kt") public void testInapplicableMixedSequence() throws Exception { - doTestConvertNegatedBooleanSequence("idea/testData/intentions/convertNegatedBooleanSequence/inapplicableMixedSequence.kt"); + doTest("idea/testData/intentions/convertNegatedBooleanSequence/inapplicableMixedSequence.kt"); } @TestMetadata("inapplicableSingleExpression.kt") public void testInapplicableSingleExpression() throws Exception { - doTestConvertNegatedBooleanSequence("idea/testData/intentions/convertNegatedBooleanSequence/inapplicableSingleExpression.kt"); + doTest("idea/testData/intentions/convertNegatedBooleanSequence/inapplicableSingleExpression.kt"); } @TestMetadata("negatedFunction.kt") public void testNegatedFunction() throws Exception { - doTestConvertNegatedBooleanSequence("idea/testData/intentions/convertNegatedBooleanSequence/negatedFunction.kt"); + doTest("idea/testData/intentions/convertNegatedBooleanSequence/negatedFunction.kt"); } @TestMetadata("parenthesizedConjunctionOfTwoNegations.kt") public void testParenthesizedConjunctionOfTwoNegations() throws Exception { - doTestConvertNegatedBooleanSequence("idea/testData/intentions/convertNegatedBooleanSequence/parenthesizedConjunctionOfTwoNegations.kt"); + doTest("idea/testData/intentions/convertNegatedBooleanSequence/parenthesizedConjunctionOfTwoNegations.kt"); } } @@ -3264,647 +2355,915 @@ public class CodeTransformationTestGenerated extends AbstractCodeTransformationT @TestMetadata("complexNegation1.kt") public void testComplexNegation1() throws Exception { - doTestConvertNegatedExpressionWithDemorgansLaw("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/complexNegation1.kt"); + doTest("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/complexNegation1.kt"); } @TestMetadata("complexNegation2.kt") public void testComplexNegation2() throws Exception { - doTestConvertNegatedExpressionWithDemorgansLaw("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/complexNegation2.kt"); + doTest("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/complexNegation2.kt"); } @TestMetadata("conjunctionNegation1.kt") public void testConjunctionNegation1() throws Exception { - doTestConvertNegatedExpressionWithDemorgansLaw("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/conjunctionNegation1.kt"); + doTest("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/conjunctionNegation1.kt"); } @TestMetadata("conjunctionNegation2.kt") public void testConjunctionNegation2() throws Exception { - doTestConvertNegatedExpressionWithDemorgansLaw("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/conjunctionNegation2.kt"); + doTest("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/conjunctionNegation2.kt"); } @TestMetadata("disjunctionNegation1.kt") public void testDisjunctionNegation1() throws Exception { - doTestConvertNegatedExpressionWithDemorgansLaw("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/disjunctionNegation1.kt"); + doTest("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/disjunctionNegation1.kt"); } @TestMetadata("disjunctionNegation2.kt") public void testDisjunctionNegation2() throws Exception { - doTestConvertNegatedExpressionWithDemorgansLaw("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/disjunctionNegation2.kt"); + doTest("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/disjunctionNegation2.kt"); } @TestMetadata("doubleNegation.kt") public void testDoubleNegation() throws Exception { - doTestConvertNegatedExpressionWithDemorgansLaw("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/doubleNegation.kt"); + doTest("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/doubleNegation.kt"); } @TestMetadata("inapplicableNormalExpression.kt") public void testInapplicableNormalExpression() throws Exception { - doTestConvertNegatedExpressionWithDemorgansLaw("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/inapplicableNormalExpression.kt"); + doTest("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/inapplicableNormalExpression.kt"); } @TestMetadata("inapplicableOperator.kt") public void testInapplicableOperator() throws Exception { - doTestConvertNegatedExpressionWithDemorgansLaw("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/inapplicableOperator.kt"); + doTest("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/inapplicableOperator.kt"); } @TestMetadata("inapplicableTriple.kt") public void testInapplicableTriple() throws Exception { - doTestConvertNegatedExpressionWithDemorgansLaw("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/inapplicableTriple.kt"); + doTest("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/inapplicableTriple.kt"); } @TestMetadata("longMixedExpression.kt") public void testLongMixedExpression() throws Exception { - doTestConvertNegatedExpressionWithDemorgansLaw("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/longMixedExpression.kt"); + doTest("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/longMixedExpression.kt"); } @TestMetadata("mixedExpression.kt") public void testMixedExpression() throws Exception { - doTestConvertNegatedExpressionWithDemorgansLaw("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/mixedExpression.kt"); + doTest("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/mixedExpression.kt"); } @TestMetadata("nonstandardPrefixOperator.kt") public void testNonstandardPrefixOperator() throws Exception { - doTestConvertNegatedExpressionWithDemorgansLaw("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/nonstandardPrefixOperator.kt"); + doTest("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/nonstandardPrefixOperator.kt"); } @TestMetadata("retainedParens.kt") public void testRetainedParens() throws Exception { - doTestConvertNegatedExpressionWithDemorgansLaw("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/retainedParens.kt"); + doTest("idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/retainedParens.kt"); } } - @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("idea/testData/intentions/convertToBlockBody") + public static class ConvertToBlockBody extends AbstractCodeTransformationTest { + public void testAllFilesPresentInConvertToBlockBody() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/convertToBlockBody"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("explicitlyNonUnitFun.kt") + public void testExplicitlyNonUnitFun() throws Exception { + doTest("idea/testData/intentions/convertToBlockBody/explicitlyNonUnitFun.kt"); + } + + @TestMetadata("explicitlyTypedFunWithUnresolvedExpression.kt") + public void testExplicitlyTypedFunWithUnresolvedExpression() throws Exception { + doTest("idea/testData/intentions/convertToBlockBody/explicitlyTypedFunWithUnresolvedExpression.kt"); + } + + @TestMetadata("explicitlyTypedFunWithUnresolvedType.kt") + public void testExplicitlyTypedFunWithUnresolvedType() throws Exception { + doTest("idea/testData/intentions/convertToBlockBody/explicitlyTypedFunWithUnresolvedType.kt"); + } + + @TestMetadata("explicitlyUnitFun.kt") + public void testExplicitlyUnitFun() throws Exception { + doTest("idea/testData/intentions/convertToBlockBody/explicitlyUnitFun.kt"); + } + + @TestMetadata("explicitlyUnitFunWithUnresolvedExpression.kt") + public void testExplicitlyUnitFunWithUnresolvedExpression() throws Exception { + doTest("idea/testData/intentions/convertToBlockBody/explicitlyUnitFunWithUnresolvedExpression.kt"); + } + + @TestMetadata("funWithThrow.kt") + public void testFunWithThrow() throws Exception { + doTest("idea/testData/intentions/convertToBlockBody/funWithThrow.kt"); + } + + @TestMetadata("getter.kt") + public void testGetter() throws Exception { + doTest("idea/testData/intentions/convertToBlockBody/getter.kt"); + } + + @TestMetadata("getterWithThrow.kt") + public void testGetterWithThrow() throws Exception { + doTest("idea/testData/intentions/convertToBlockBody/getterWithThrow.kt"); + } + + @TestMetadata("implicitlyNonUnitFun.kt") + public void testImplicitlyNonUnitFun() throws Exception { + doTest("idea/testData/intentions/convertToBlockBody/implicitlyNonUnitFun.kt"); + } + + @TestMetadata("implicitlyTypedFunWithUnresolvedType.kt") + public void testImplicitlyTypedFunWithUnresolvedType() throws Exception { + doTest("idea/testData/intentions/convertToBlockBody/implicitlyTypedFunWithUnresolvedType.kt"); + } + + @TestMetadata("implicitlyUnitFun.kt") + public void testImplicitlyUnitFun() throws Exception { + doTest("idea/testData/intentions/convertToBlockBody/implicitlyUnitFun.kt"); + } + + @TestMetadata("nothingFun.kt") + public void testNothingFun() throws Exception { + doTest("idea/testData/intentions/convertToBlockBody/nothingFun.kt"); + } + + @TestMetadata("setter.kt") + public void testSetter() throws Exception { + doTest("idea/testData/intentions/convertToBlockBody/setter.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/convertToConcatenatedStringIntention") + public static class ConvertToConcatenatedStringIntention extends AbstractCodeTransformationTest { + public void testAllFilesPresentInConvertToConcatenatedStringIntention() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/convertToConcatenatedStringIntention"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("embeddedIf.kt") + public void testEmbeddedIf() throws Exception { + doTest("idea/testData/intentions/convertToConcatenatedStringIntention/embeddedIf.kt"); + } + + @TestMetadata("embeddedIfBraces.kt") + public void testEmbeddedIfBraces() throws Exception { + doTest("idea/testData/intentions/convertToConcatenatedStringIntention/embeddedIfBraces.kt"); + } + + @TestMetadata("handlesEscapeString.kt") + public void testHandlesEscapeString() throws Exception { + doTest("idea/testData/intentions/convertToConcatenatedStringIntention/handlesEscapeString.kt"); + } + + @TestMetadata("interpolate2StringConstants.kt") + public void testInterpolate2StringConstants() throws Exception { + doTest("idea/testData/intentions/convertToConcatenatedStringIntention/interpolate2StringConstants.kt"); + } + + @TestMetadata("interpolate3.kt") + public void testInterpolate3() throws Exception { + doTest("idea/testData/intentions/convertToConcatenatedStringIntention/interpolate3.kt"); + } + + @TestMetadata("interpolateChar.kt") + public void testInterpolateChar() throws Exception { + doTest("idea/testData/intentions/convertToConcatenatedStringIntention/interpolateChar.kt"); + } + + @TestMetadata("interpolateConstants.kt") + public void testInterpolateConstants() throws Exception { + doTest("idea/testData/intentions/convertToConcatenatedStringIntention/interpolateConstants.kt"); + } + + @TestMetadata("interpolateMapAccess.kt") + public void testInterpolateMapAccess() throws Exception { + doTest("idea/testData/intentions/convertToConcatenatedStringIntention/interpolateMapAccess.kt"); + } + + @TestMetadata("interpolateMethodInvoke.kt") + public void testInterpolateMethodInvoke() throws Exception { + doTest("idea/testData/intentions/convertToConcatenatedStringIntention/interpolateMethodInvoke.kt"); + } + + @TestMetadata("interpolateSimpleWithBraces.kt") + public void testInterpolateSimpleWithBraces() throws Exception { + doTest("idea/testData/intentions/convertToConcatenatedStringIntention/interpolateSimpleWithBraces.kt"); + } + + @TestMetadata("interpolateStringWithFloat.kt") + public void testInterpolateStringWithFloat() throws Exception { + doTest("idea/testData/intentions/convertToConcatenatedStringIntention/interpolateStringWithFloat.kt"); + } + + @TestMetadata("interpolateStringWithInt.kt") + public void testInterpolateStringWithInt() throws Exception { + doTest("idea/testData/intentions/convertToConcatenatedStringIntention/interpolateStringWithInt.kt"); + } + + @TestMetadata("lastExprIsNamedExpression.kt") + public void testLastExprIsNamedExpression() throws Exception { + doTest("idea/testData/intentions/convertToConcatenatedStringIntention/lastExprIsNamedExpression.kt"); + } + + @TestMetadata("multilineString.kt") + public void testMultilineString() throws Exception { + doTest("idea/testData/intentions/convertToConcatenatedStringIntention/multilineString.kt"); + } + + @TestMetadata("multilineWhenExpr.kt") + public void testMultilineWhenExpr() throws Exception { + doTest("idea/testData/intentions/convertToConcatenatedStringIntention/multilineWhenExpr.kt"); + } + + @TestMetadata("namedExprBetweenConstants.kt") + public void testNamedExprBetweenConstants() throws Exception { + doTest("idea/testData/intentions/convertToConcatenatedStringIntention/namedExprBetweenConstants.kt"); + } + + @TestMetadata("notApplicableForErrorElement.kt") + public void testNotApplicableForErrorElement() throws Exception { + doTest("idea/testData/intentions/convertToConcatenatedStringIntention/notApplicableForErrorElement.kt"); + } + + @TestMetadata("notApplicableForSimple.kt") + public void testNotApplicableForSimple() throws Exception { + doTest("idea/testData/intentions/convertToConcatenatedStringIntention/notApplicableForSimple.kt"); + } + + @TestMetadata("notAvailableForDollarSignLiteral.kt") + public void testNotAvailableForDollarSignLiteral() throws Exception { + doTest("idea/testData/intentions/convertToConcatenatedStringIntention/notAvailableForDollarSignLiteral.kt"); + } + + @TestMetadata("singleVar.kt") + public void testSingleVar() throws Exception { + doTest("idea/testData/intentions/convertToConcatenatedStringIntention/singleVar.kt"); + } + + @TestMetadata("startsWithInt.kt") + public void testStartsWithInt() throws Exception { + doTest("idea/testData/intentions/convertToConcatenatedStringIntention/startsWithInt.kt"); + } + + @TestMetadata("startsWithStringExpression.kt") + public void testStartsWithStringExpression() throws Exception { + doTest("idea/testData/intentions/convertToConcatenatedStringIntention/startsWithStringExpression.kt"); + } + + @TestMetadata("tricky.kt") + public void testTricky() throws Exception { + doTest("idea/testData/intentions/convertToConcatenatedStringIntention/tricky.kt"); + } + + @TestMetadata("withAndWithoutBraces.kt") + public void testWithAndWithoutBraces() throws Exception { + doTest("idea/testData/intentions/convertToConcatenatedStringIntention/withAndWithoutBraces.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/convertToExpressionBody") + public static class ConvertToExpressionBody extends AbstractCodeTransformationTest { + public void testAllFilesPresentInConvertToExpressionBody() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/convertToExpressionBody"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("anonymousObjectExpression.kt") + public void testAnonymousObjectExpression() throws Exception { + doTest("idea/testData/intentions/convertToExpressionBody/anonymousObjectExpression.kt"); } @TestMetadata("assignment.kt") public void testAssignment() throws Exception { - doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/assignment.kt"); + doTest("idea/testData/intentions/convertToExpressionBody/assignment.kt"); } - @TestMetadata("compareTo.kt") - public void testCompareTo() throws Exception { - doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/compareTo.kt"); + @TestMetadata("declaration.kt") + public void testDeclaration() throws Exception { + doTest("idea/testData/intentions/convertToExpressionBody/declaration.kt"); } - @TestMetadata("conjunction.kt") - public void testConjunction() throws Exception { - doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/conjunction.kt"); + @TestMetadata("expressionWithReturns1.kt") + public void testExpressionWithReturns1() throws Exception { + doTest("idea/testData/intentions/convertToExpressionBody/expressionWithReturns1.kt"); } - @TestMetadata("conjunctionLiteral.kt") - public void testConjunctionLiteral() throws Exception { - doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/conjunctionLiteral.kt"); + @TestMetadata("expressionWithReturns2.kt") + public void testExpressionWithReturns2() throws Exception { + doTest("idea/testData/intentions/convertToExpressionBody/expressionWithReturns2.kt"); } - @TestMetadata("disjunction.kt") - public void testDisjunction() throws Exception { - doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/disjunction.kt"); + @TestMetadata("funWithImplicitUnitTypeWithThrow.kt") + public void testFunWithImplicitUnitTypeWithThrow() throws Exception { + doTest("idea/testData/intentions/convertToExpressionBody/funWithImplicitUnitTypeWithThrow.kt"); } - @TestMetadata("disjunctionLiteral.kt") - public void testDisjunctionLiteral() throws Exception { - doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/disjunctionLiteral.kt"); + @TestMetadata("funWithNoBlock.kt") + public void testFunWithNoBlock() throws Exception { + doTest("idea/testData/intentions/convertToExpressionBody/funWithNoBlock.kt"); } - @TestMetadata("divide.kt") - public void testDivide() throws Exception { - doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/divide.kt"); + @TestMetadata("funWithNothingType.kt") + public void testFunWithNothingType() throws Exception { + doTest("idea/testData/intentions/convertToExpressionBody/funWithNothingType.kt"); } - @TestMetadata("divideAssign.kt") - public void testDivideAssign() throws Exception { - doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/divideAssign.kt"); + @TestMetadata("funWithReturn.kt") + public void testFunWithReturn() throws Exception { + doTest("idea/testData/intentions/convertToExpressionBody/funWithReturn.kt"); } - @TestMetadata("divideLiteral.kt") - public void testDivideLiteral() throws Exception { - doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/divideLiteral.kt"); + @TestMetadata("funWithUnitType.kt") + public void testFunWithUnitType() throws Exception { + doTest("idea/testData/intentions/convertToExpressionBody/funWithUnitType.kt"); } - @TestMetadata("equals.kt") - public void testEquals() throws Exception { - doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/equals.kt"); + @TestMetadata("funWithUnitType2.kt") + public void testFunWithUnitType2() throws Exception { + doTest("idea/testData/intentions/convertToExpressionBody/funWithUnitType2.kt"); } - @TestMetadata("equalsLiteral.kt") - public void testEqualsLiteral() throws Exception { - doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/equalsLiteral.kt"); + @TestMetadata("funWithUnitTypeWithThrow.kt") + public void testFunWithUnitTypeWithThrow() throws Exception { + doTest("idea/testData/intentions/convertToExpressionBody/funWithUnitTypeWithThrow.kt"); } - @TestMetadata("greaterThan.kt") - public void testGreaterThan() throws Exception { - doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/greaterThan.kt"); + @TestMetadata("functionLiteral.kt") + public void testFunctionLiteral() throws Exception { + doTest("idea/testData/intentions/convertToExpressionBody/functionLiteral.kt"); } - @TestMetadata("greaterThanEquals.kt") - public void testGreaterThanEquals() throws Exception { - doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/greaterThanEquals.kt"); + @TestMetadata("getWithReturn.kt") + public void testGetWithReturn() throws Exception { + doTest("idea/testData/intentions/convertToExpressionBody/getWithReturn.kt"); } - @TestMetadata("identityEquals.kt") - public void testIdentityEquals() throws Exception { - doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/identityEquals.kt"); + @TestMetadata("multipleStatements.kt") + public void testMultipleStatements() throws Exception { + doTest("idea/testData/intentions/convertToExpressionBody/multipleStatements.kt"); } - @TestMetadata("identityEqualsLiteral.kt") - public void testIdentityEqualsLiteral() throws Exception { - doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/identityEqualsLiteral.kt"); + @TestMetadata("returnWithNoValue.kt") + public void testReturnWithNoValue() throws Exception { + doTest("idea/testData/intentions/convertToExpressionBody/returnWithNoValue.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("multipleOperandsWithDifferentPrecedence.kt") - public void testMultipleOperandsWithDifferentPrecedence() throws Exception { - doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/multipleOperandsWithDifferentPrecedence.kt"); - } - - @TestMetadata("multipleOperandsWithDifferentPrecedence2.kt") - public void testMultipleOperandsWithDifferentPrecedence2() throws Exception { - doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/multipleOperandsWithDifferentPrecedence2.kt"); - } - - @TestMetadata("multipleOperandsWithDifferentPrecedence3.kt") - public void testMultipleOperandsWithDifferentPrecedence3() throws Exception { - doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/multipleOperandsWithDifferentPrecedence3.kt"); - } - - @TestMetadata("multipleOperandsWithDifferentPrecedence4.kt") - public void testMultipleOperandsWithDifferentPrecedence4() throws Exception { - doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/multipleOperandsWithDifferentPrecedence4.kt"); - } - - @TestMetadata("multipleOperandsWithDifferentPrecedence5.kt") - public void testMultipleOperandsWithDifferentPrecedence5() throws Exception { - doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/multipleOperandsWithDifferentPrecedence5.kt"); - } - - @TestMetadata("multipleOperandsWithDifferentPrecedence6.kt") - public void testMultipleOperandsWithDifferentPrecedence6() throws Exception { - doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/multipleOperandsWithDifferentPrecedence6.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("notEquals.kt") - public void testNotEquals() throws Exception { - doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/notEquals.kt"); - } - - @TestMetadata("notIdentityEquals.kt") - public void testNotIdentityEquals() throws Exception { - doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/notIdentityEquals.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("plusMinus.kt") - public void testPlusMinus() throws Exception { - doTestSwapBinaryExpression("idea/testData/intentions/swapBinaryExpression/plusMinus.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"); + @TestMetadata("while.kt") + public void testWhile() throws Exception { + doTest("idea/testData/intentions/convertToExpressionBody/while.kt"); } } - @TestMetadata("idea/testData/intentions/splitIf") - public static class SplitIf extends AbstractCodeTransformationTest { - public void testAllFilesPresentInSplitIf() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/splitIf"), Pattern.compile("^(.+)\\.kt$"), true); + @TestMetadata("idea/testData/intentions/convertToForEachFunctionCall") + public static class ConvertToForEachFunctionCall extends AbstractCodeTransformationTest { + public void testAllFilesPresentInConvertToForEachFunctionCall() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/convertToForEachFunctionCall"), Pattern.compile("^(.+)\\.kt$"), true); } - @TestMetadata("splitIfAndOr.kt") - public void testSplitIfAndOr() throws Exception { - doTestSplitIf("idea/testData/intentions/splitIf/splitIfAndOr.kt"); + @TestMetadata("binaryExpressionLoopRange.kt") + public void testBinaryExpressionLoopRange() throws Exception { + doTest("idea/testData/intentions/convertToForEachFunctionCall/binaryExpressionLoopRange.kt"); } - @TestMetadata("splitIfAndOrWithBraces.kt") - public void testSplitIfAndOrWithBraces() throws Exception { - doTestSplitIf("idea/testData/intentions/splitIf/splitIfAndOrWithBraces.kt"); + @TestMetadata("blockBodyExpression.kt") + public void testBlockBodyExpression() throws Exception { + doTest("idea/testData/intentions/convertToForEachFunctionCall/blockBodyExpression.kt"); } - @TestMetadata("splitIfAndWithBraces.kt") - public void testSplitIfAndWithBraces() throws Exception { - doTestSplitIf("idea/testData/intentions/splitIf/splitIfAndWithBraces.kt"); + @TestMetadata("iterativeElementTypeSpecified.kt") + public void testIterativeElementTypeSpecified() throws Exception { + doTest("idea/testData/intentions/convertToForEachFunctionCall/iterativeElementTypeSpecified.kt"); } - @TestMetadata("splitIfCaretOnIf.kt") - public void testSplitIfCaretOnIf() throws Exception { - doTestSplitIf("idea/testData/intentions/splitIf/splitIfCaretOnIf.kt"); + @TestMetadata("noCurlyBraces.kt") + public void testNoCurlyBraces() throws Exception { + doTest("idea/testData/intentions/convertToForEachFunctionCall/noCurlyBraces.kt"); } - @TestMetadata("splitIfNestedIf.kt") - public void testSplitIfNestedIf() throws Exception { - doTestSplitIf("idea/testData/intentions/splitIf/splitIfNestedIf.kt"); - } - - @TestMetadata("splitIfNestedIfNotApplicable.kt") - public void testSplitIfNestedIfNotApplicable() throws Exception { - doTestSplitIf("idea/testData/intentions/splitIf/splitIfNestedIfNotApplicable.kt"); - } - - @TestMetadata("splitIfNestedInside.kt") - public void testSplitIfNestedInside() throws Exception { - doTestSplitIf("idea/testData/intentions/splitIf/splitIfNestedInside.kt"); - } - - @TestMetadata("splitIfNestedOutside.kt") - public void testSplitIfNestedOutside() throws Exception { - doTestSplitIf("idea/testData/intentions/splitIf/splitIfNestedOutside.kt"); - } - - @TestMetadata("splitIfNotIf.kt") - public void testSplitIfNotIf() throws Exception { - doTestSplitIf("idea/testData/intentions/splitIf/splitIfNotIf.kt"); - } - - @TestMetadata("splitIfOnIfWithOr.kt") - public void testSplitIfOnIfWithOr() throws Exception { - doTestSplitIf("idea/testData/intentions/splitIf/splitIfOnIfWithOr.kt"); - } - - @TestMetadata("splitIfOneAND.kt") - public void testSplitIfOneAND() throws Exception { - doTestSplitIf("idea/testData/intentions/splitIf/splitIfOneAND.kt"); - } - - @TestMetadata("splitIfOperatorAsFunctionParam.kt") - public void testSplitIfOperatorAsFunctionParam() throws Exception { - doTestSplitIf("idea/testData/intentions/splitIf/splitIfOperatorAsFunctionParam.kt"); - } - - @TestMetadata("splitIfOperatorOutsideIf.kt") - public void testSplitIfOperatorOutsideIf() throws Exception { - doTestSplitIf("idea/testData/intentions/splitIf/splitIfOperatorOutsideIf.kt"); - } - - @TestMetadata("splitIfOrAnd.kt") - public void testSplitIfOrAnd() throws Exception { - doTestSplitIf("idea/testData/intentions/splitIf/splitIfOrAnd.kt"); - } - - @TestMetadata("splitIfOrWithBraces.kt") - public void testSplitIfOrWithBraces() throws Exception { - doTestSplitIf("idea/testData/intentions/splitIf/splitIfOrWithBraces.kt"); - } - - @TestMetadata("splitIfTwoOperatorsFirst.kt") - public void testSplitIfTwoOperatorsFirst() throws Exception { - doTestSplitIf("idea/testData/intentions/splitIf/splitIfTwoOperatorsFirst.kt"); - } - - @TestMetadata("splitIfTwoOperatorsSecond.kt") - public void testSplitIfTwoOperatorsSecond() throws Exception { - doTestSplitIf("idea/testData/intentions/splitIf/splitIfTwoOperatorsSecond.kt"); - } - - @TestMetadata("splitIfWithElse.kt") - public void testSplitIfWithElse() throws Exception { - doTestSplitIf("idea/testData/intentions/splitIf/splitIfWithElse.kt"); - } - - @TestMetadata("splitIfWithFunction.kt") - public void testSplitIfWithFunction() throws Exception { - doTestSplitIf("idea/testData/intentions/splitIf/splitIfWithFunction.kt"); - } - - @TestMetadata("splitIfWithNotOperator.kt") - public void testSplitIfWithNotOperator() throws Exception { - doTestSplitIf("idea/testData/intentions/splitIf/splitIfWithNotOperator.kt"); - } - - @TestMetadata("splitIfWithNotOperatorGood.kt") - public void testSplitIfWithNotOperatorGood() throws Exception { - doTestSplitIf("idea/testData/intentions/splitIf/splitIfWithNotOperatorGood.kt"); - } - - @TestMetadata("splitIfWithOR.kt") - public void testSplitIfWithOR() throws Exception { - doTestSplitIf("idea/testData/intentions/splitIf/splitIfWithOR.kt"); - } - - @TestMetadata("splitIfWithORElse.kt") - public void testSplitIfWithORElse() throws Exception { - doTestSplitIf("idea/testData/intentions/splitIf/splitIfWithORElse.kt"); - } - - @TestMetadata("splitIfWrongCaretLocation.kt") - public void testSplitIfWrongCaretLocation() throws Exception { - doTestSplitIf("idea/testData/intentions/splitIf/splitIfWrongCaretLocation.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/replaceWithOperatorAssign") - public static class ReplaceWithOperatorAssign extends AbstractCodeTransformationTest { - public void testAllFilesPresentInReplaceWithOperatorAssign() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/replaceWithOperatorAssign"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("illegalMultipleOperators.kt") - public void testIllegalMultipleOperators() throws Exception { - doTestReplaceWithOperatorAssign("idea/testData/intentions/replaceWithOperatorAssign/illegalMultipleOperators.kt"); - } - - @TestMetadata("illegalMultipleOperatorsMiddle.kt") - public void testIllegalMultipleOperatorsMiddle() throws Exception { - doTestReplaceWithOperatorAssign("idea/testData/intentions/replaceWithOperatorAssign/illegalMultipleOperatorsMiddle.kt"); - } - - @TestMetadata("invalidSubtraction.kt") - public void testInvalidSubtraction() throws Exception { - doTestReplaceWithOperatorAssign("idea/testData/intentions/replaceWithOperatorAssign/invalidSubtraction.kt"); - } - - @TestMetadata("multipleOperators.kt") - public void testMultipleOperators() throws Exception { - doTestReplaceWithOperatorAssign("idea/testData/intentions/replaceWithOperatorAssign/multipleOperators.kt"); - } - - @TestMetadata("multipleOperatorsRightSideRepeat.kt") - public void testMultipleOperatorsRightSideRepeat() throws Exception { - doTestReplaceWithOperatorAssign("idea/testData/intentions/replaceWithOperatorAssign/multipleOperatorsRightSideRepeat.kt"); - } - - @TestMetadata("nonRepeatingAssignment.kt") - public void testNonRepeatingAssignment() throws Exception { - doTestReplaceWithOperatorAssign("idea/testData/intentions/replaceWithOperatorAssign/nonRepeatingAssignment.kt"); - } - - @TestMetadata("rightSideRepeat.kt") - public void testRightSideRepeat() throws Exception { - doTestReplaceWithOperatorAssign("idea/testData/intentions/replaceWithOperatorAssign/rightSideRepeat.kt"); - } - - @TestMetadata("simpleAssign.kt") - public void testSimpleAssign() throws Exception { - doTestReplaceWithOperatorAssign("idea/testData/intentions/replaceWithOperatorAssign/simpleAssign.kt"); - } - - @TestMetadata("validSubtraction.kt") - public void testValidSubtraction() throws Exception { - doTestReplaceWithOperatorAssign("idea/testData/intentions/replaceWithOperatorAssign/validSubtraction.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/replaceWithTraditionalAssignment") - public static class ReplaceWithTraditionalAssignment extends AbstractCodeTransformationTest { - public void testAllFilesPresentInReplaceWithTraditionalAssignment() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/replaceWithTraditionalAssignment"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("complexRightExpression.kt") - public void testComplexRightExpression() throws Exception { - doTestReplaceWithTraditionalAssignment("idea/testData/intentions/replaceWithTraditionalAssignment/complexRightExpression.kt"); - } - - @TestMetadata("nonAssignmentExpression.kt") - public void testNonAssignmentExpression() throws Exception { - doTestReplaceWithTraditionalAssignment("idea/testData/intentions/replaceWithTraditionalAssignment/nonAssignmentExpression.kt"); - } - - @TestMetadata("nonAugmentedAssign.kt") - public void testNonAugmentedAssign() throws Exception { - doTestReplaceWithTraditionalAssignment("idea/testData/intentions/replaceWithTraditionalAssignment/nonAugmentedAssign.kt"); + @TestMetadata("noStatements.kt") + public void testNoStatements() throws Exception { + doTest("idea/testData/intentions/convertToForEachFunctionCall/noStatements.kt"); } @TestMetadata("simple.kt") public void testSimple() throws Exception { - doTestReplaceWithTraditionalAssignment("idea/testData/intentions/replaceWithTraditionalAssignment/simple.kt"); + doTest("idea/testData/intentions/convertToForEachFunctionCall/simple.kt"); + } + + @TestMetadata("typeAnnotatedWithNonBlockBody.kt") + public void testTypeAnnotatedWithNonBlockBody() throws Exception { + doTest("idea/testData/intentions/convertToForEachFunctionCall/typeAnnotatedWithNonBlockBody.kt"); } } - @TestMetadata("idea/testData/intentions/simplifyBooleanWithConstants") - public static class SimplifyBooleanWithConstants extends AbstractCodeTransformationTest { - public void testAllFilesPresentInSimplifyBooleanWithConstants() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/simplifyBooleanWithConstants"), Pattern.compile("^(.+)\\.kt$"), true); + @TestMetadata("idea/testData/intentions/convertToForEachLoop") + public static class ConvertToForEachLoop extends AbstractCodeTransformationTest { + public void testAllFilesPresentInConvertToForEachLoop() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/convertToForEachLoop"), Pattern.compile("^(.+)\\.kt$"), true); } - @TestMetadata("inapplicableNoConstants.kt") - public void testInapplicableNoConstants() throws Exception { - doTestSimplifyBooleanWithConstants("idea/testData/intentions/simplifyBooleanWithConstants/inapplicableNoConstants.kt"); + @TestMetadata("complexReceiver.kt") + public void testComplexReceiver() throws Exception { + doTest("idea/testData/intentions/convertToForEachLoop/complexReceiver.kt"); } - @TestMetadata("inapplicableNotBinary.kt") - public void testInapplicableNotBinary() throws Exception { - doTestSimplifyBooleanWithConstants("idea/testData/intentions/simplifyBooleanWithConstants/inapplicableNotBinary.kt"); + @TestMetadata("explicitFunctionLiteral.kt") + public void testExplicitFunctionLiteral() throws Exception { + doTest("idea/testData/intentions/convertToForEachLoop/explicitFunctionLiteral.kt"); } - @TestMetadata("inapplicableUsesVals.kt") - public void testInapplicableUsesVals() throws Exception { - doTestSimplifyBooleanWithConstants("idea/testData/intentions/simplifyBooleanWithConstants/inapplicableUsesVals.kt"); + @TestMetadata("extraArguments.kt") + public void testExtraArguments() throws Exception { + doTest("idea/testData/intentions/convertToForEachLoop/extraArguments.kt"); } - @TestMetadata("inapplicableUsesVals2.kt") - public void testInapplicableUsesVals2() throws Exception { - doTestSimplifyBooleanWithConstants("idea/testData/intentions/simplifyBooleanWithConstants/inapplicableUsesVals2.kt"); + @TestMetadata("implicitFunctionLiteralParameter.kt") + public void testImplicitFunctionLiteralParameter() throws Exception { + doTest("idea/testData/intentions/convertToForEachLoop/implicitFunctionLiteralParameter.kt"); } - @TestMetadata("inapplicableUsesVals3.kt") - public void testInapplicableUsesVals3() throws Exception { - doTestSimplifyBooleanWithConstants("idea/testData/intentions/simplifyBooleanWithConstants/inapplicableUsesVals3.kt"); + @TestMetadata("infixCall.kt") + public void testInfixCall() throws Exception { + doTest("idea/testData/intentions/convertToForEachLoop/infixCall.kt"); } - @TestMetadata("reduceableBinary.kt") - public void testReduceableBinary() throws Exception { - doTestSimplifyBooleanWithConstants("idea/testData/intentions/simplifyBooleanWithConstants/reduceableBinary.kt"); - } - - @TestMetadata("reduceableBinary2.kt") - public void testReduceableBinary2() throws Exception { - doTestSimplifyBooleanWithConstants("idea/testData/intentions/simplifyBooleanWithConstants/reduceableBinary2.kt"); - } - - @TestMetadata("reduceableBinary3.kt") - public void testReduceableBinary3() throws Exception { - doTestSimplifyBooleanWithConstants("idea/testData/intentions/simplifyBooleanWithConstants/reduceableBinary3.kt"); - } - - @TestMetadata("reduceableBinaryWithParenthese.kt") - public void testReduceableBinaryWithParenthese() throws Exception { - doTestSimplifyBooleanWithConstants("idea/testData/intentions/simplifyBooleanWithConstants/reduceableBinaryWithParenthese.kt"); + @TestMetadata("parenthesizedExpression.kt") + public void testParenthesizedExpression() throws Exception { + doTest("idea/testData/intentions/convertToForEachLoop/parenthesizedExpression.kt"); } @TestMetadata("simple.kt") public void testSimple() throws Exception { - doTestSimplifyBooleanWithConstants("idea/testData/intentions/simplifyBooleanWithConstants/simple.kt"); + doTest("idea/testData/intentions/convertToForEachLoop/simple.kt"); } - @TestMetadata("simpleWithMoreBinaries.kt") - public void testSimpleWithMoreBinaries() throws Exception { - doTestSimplifyBooleanWithConstants("idea/testData/intentions/simplifyBooleanWithConstants/simpleWithMoreBinaries.kt"); + @TestMetadata("typeArgumentPresent.kt") + public void testTypeArgumentPresent() throws Exception { + doTest("idea/testData/intentions/convertToForEachLoop/typeArgumentPresent.kt"); } - @TestMetadata("simpleWithMoreBinaries2.kt") - public void testSimpleWithMoreBinaries2() throws Exception { - doTestSimplifyBooleanWithConstants("idea/testData/intentions/simplifyBooleanWithConstants/simpleWithMoreBinaries2.kt"); + @TestMetadata("userDefined.kt") + public void testUserDefined() throws Exception { + doTest("idea/testData/intentions/convertToForEachLoop/userDefined.kt"); } - @TestMetadata("simpleWithMoreBinaries3.kt") - public void testSimpleWithMoreBinaries3() throws Exception { - doTestSimplifyBooleanWithConstants("idea/testData/intentions/simplifyBooleanWithConstants/simpleWithMoreBinaries3.kt"); + @TestMetadata("zeroArguments.kt") + public void testZeroArguments() throws Exception { + doTest("idea/testData/intentions/convertToForEachLoop/zeroArguments.kt"); } - @TestMetadata("simpleWithMoreBinariesAndParentheses.kt") - public void testSimpleWithMoreBinariesAndParentheses() throws Exception { - doTestSimplifyBooleanWithConstants("idea/testData/intentions/simplifyBooleanWithConstants/simpleWithMoreBinariesAndParentheses.kt"); + } + + @TestMetadata("idea/testData/intentions/convertToStringTemplateIntention") + public static class ConvertToStringTemplateIntention extends AbstractCodeTransformationTest { + public void testAllFilesPresentInConvertToStringTemplateIntention() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/convertToStringTemplateIntention"), Pattern.compile("^(.+)\\.kt$"), true); } - @TestMetadata("simpleWithMoreBinariesAndParentheses2.kt") - public void testSimpleWithMoreBinariesAndParentheses2() throws Exception { - doTestSimplifyBooleanWithConstants("idea/testData/intentions/simplifyBooleanWithConstants/simpleWithMoreBinariesAndParentheses2.kt"); + @TestMetadata("backslashNMultilineString.kt") + public void testBackslashNMultilineString() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/backslashNMultilineString.kt"); } - @TestMetadata("simpleWithMoreBinariesAndParentheses3.kt") - public void testSimpleWithMoreBinariesAndParentheses3() throws Exception { - doTestSimplifyBooleanWithConstants("idea/testData/intentions/simplifyBooleanWithConstants/simpleWithMoreBinariesAndParentheses3.kt"); + @TestMetadata("combineEmptyStrings.kt") + public void testCombineEmptyStrings() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/combineEmptyStrings.kt"); } - @TestMetadata("simpleWithNonsensical2.kt") - public void testSimpleWithNonsensical2() throws Exception { - doTestSimplifyBooleanWithConstants("idea/testData/intentions/simplifyBooleanWithConstants/simpleWithNonsensical2.kt"); + @TestMetadata("combinesNonStringsAsStrings.kt") + public void testCombinesNonStringsAsStrings() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/combinesNonStringsAsStrings.kt"); } - @TestMetadata("simpleWithParentheses.kt") - public void testSimpleWithParentheses() throws Exception { - doTestSimplifyBooleanWithConstants("idea/testData/intentions/simplifyBooleanWithConstants/simpleWithParentheses.kt"); + @TestMetadata("combinesNonStringsAsStrings2.kt") + public void testCombinesNonStringsAsStrings2() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/combinesNonStringsAsStrings2.kt"); } - @TestMetadata("simpleWithParentheses2.kt") - public void testSimpleWithParentheses2() throws Exception { - doTestSimplifyBooleanWithConstants("idea/testData/intentions/simplifyBooleanWithConstants/simpleWithParentheses2.kt"); + @TestMetadata("consecutiveNewlines.kt") + public void testConsecutiveNewlines() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/consecutiveNewlines.kt"); + } + + @TestMetadata("doesNotCorruptExistingTemplate.kt") + public void testDoesNotCorruptExistingTemplate() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/doesNotCorruptExistingTemplate.kt"); + } + + @TestMetadata("doesNotCorruptExistingTemplateWithBraces.kt") + public void testDoesNotCorruptExistingTemplateWithBraces() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/doesNotCorruptExistingTemplateWithBraces.kt"); + } + + @TestMetadata("insertBracesForSimpleNamedExpression.kt") + public void testInsertBracesForSimpleNamedExpression() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/insertBracesForSimpleNamedExpression.kt"); + } + + @TestMetadata("interpolate2StringConstants.kt") + public void testInterpolate2StringConstants() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/interpolate2StringConstants.kt"); + } + + @TestMetadata("interpolate2Vals.kt") + public void testInterpolate2Vals() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/interpolate2Vals.kt"); + } + + @TestMetadata("interpolate3Left.kt") + public void testInterpolate3Left() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/interpolate3Left.kt"); + } + + @TestMetadata("interpolate3Right.kt") + public void testInterpolate3Right() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/interpolate3Right.kt"); + } + + @TestMetadata("interpolateChar.kt") + public void testInterpolateChar() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/interpolateChar.kt"); + } + + @TestMetadata("interpolateDollarSign.kt") + public void testInterpolateDollarSign() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/interpolateDollarSign.kt"); + } + + @TestMetadata("interpolateMapAccess.kt") + public void testInterpolateMapAccess() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/interpolateMapAccess.kt"); + } + + @TestMetadata("interpolateMethodInvoke.kt") + public void testInterpolateMethodInvoke() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/interpolateMethodInvoke.kt"); + } + + @TestMetadata("interpolateMultiline.kt") + public void testInterpolateMultiline() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/interpolateMultiline.kt"); + } + + @TestMetadata("interpolateStringWithFloat.kt") + public void testInterpolateStringWithFloat() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/interpolateStringWithFloat.kt"); + } + + @TestMetadata("interpolateStringWithInt.kt") + public void testInterpolateStringWithInt() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/interpolateStringWithInt.kt"); + } + + @TestMetadata("multilineString.kt") + public void testMultilineString() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/multilineString.kt"); + } + + @TestMetadata("noBracesForLastSimpleExpression.kt") + public void testNoBracesForLastSimpleExpression() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/noBracesForLastSimpleExpression.kt"); + } + + @TestMetadata("noBracesSimpleFollowedByDot.kt") + public void testNoBracesSimpleFollowedByDot() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/noBracesSimpleFollowedByDot.kt"); + } + + @TestMetadata("notApplicableForErrorElement.kt") + public void testNotApplicableForErrorElement() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/notApplicableForErrorElement.kt"); + } + + @TestMetadata("onlyForConcat.kt") + public void testOnlyForConcat() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/onlyForConcat.kt"); + } + + @TestMetadata("onlyForStrings.kt") + public void testOnlyForStrings() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/onlyForStrings.kt"); + } + + @TestMetadata("requiresPlusOperator.kt") + public void testRequiresPlusOperator() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/requiresPlusOperator.kt"); + } + + @TestMetadata("tricky.kt") + public void testTricky() throws Exception { + doTest("idea/testData/intentions/convertToStringTemplateIntention/tricky.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/declarations") + @InnerTestClasses({Declarations.ConvertMemberToExtension.class, Declarations.Split.class}) + public static class Declarations extends AbstractCodeTransformationTest { + public void testAllFilesPresentInDeclarations() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/declarations"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("idea/testData/intentions/declarations/convertMemberToExtension") + public static class ConvertMemberToExtension extends AbstractCodeTransformationTest { + @TestMetadata("abstract.kt") + public void testAbstract() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/abstract.kt"); + } + + @TestMetadata("abstractProperty.kt") + public void testAbstractProperty() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/abstractProperty.kt"); + } + + public void testAllFilesPresentInConvertMemberToExtension() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/declarations/convertMemberToExtension"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("explicitUnit.kt") + public void testExplicitUnit() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/explicitUnit.kt"); + } + + @TestMetadata("extension.kt") + public void testExtension() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/extension.kt"); + } + + @TestMetadata("funcitonNoName.kt") + public void testFuncitonNoName() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/funcitonNoName.kt"); + } + + @TestMetadata("functionType.kt") + public void testFunctionType() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/functionType.kt"); + } + + @TestMetadata("genericClass.kt") + public void testGenericClass() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/genericClass.kt"); + } + + @TestMetadata("genericFun.kt") + public void testGenericFun() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/genericFun.kt"); + } + + @TestMetadata("genericFunInGenericClass.kt") + public void testGenericFunInGenericClass() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/genericFunInGenericClass.kt"); + } + + @TestMetadata("genericFunInGenericClassWithUpperBounds.kt") + public void testGenericFunInGenericClassWithUpperBounds() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/genericFunInGenericClassWithUpperBounds.kt"); + } + + @TestMetadata("genericFunParamAfterName.kt") + public void testGenericFunParamAfterName() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/genericFunParamAfterName.kt"); + } + + @TestMetadata("genericProperty.kt") + public void testGenericProperty() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/genericProperty.kt"); + } + + @TestMetadata("inFunctionBody.kt") + public void testInFunctionBody() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/inFunctionBody.kt"); + } + + @TestMetadata("inObject.kt") + public void testInObject() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/inObject.kt"); + } + + @TestMetadata("internal.kt") + public void testInternal() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/internal.kt"); + } + + @TestMetadata("localFunction.kt") + public void testLocalFunction() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/localFunction.kt"); + } + + @TestMetadata("nonBlockBodyNoType.kt") + public void testNonBlockBodyNoType() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/nonBlockBodyNoType.kt"); + } + + @TestMetadata("nonBlockBodyWithType.kt") + public void testNonBlockBodyWithType() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/nonBlockBodyWithType.kt"); + } + + @TestMetadata("outsideFunction.kt") + public void testOutsideFunction() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/outsideFunction.kt"); + } + + @TestMetadata("private.kt") + public void testPrivate() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/private.kt"); + } + + @TestMetadata("protected.kt") + public void testProtected() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/protected.kt"); + } + + @TestMetadata("public.kt") + public void testPublic() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/public.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/simple.kt"); + } + + @TestMetadata("topLevelFunction.kt") + public void testTopLevelFunction() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/topLevelFunction.kt"); + } + + @TestMetadata("typeFqName.kt") + public void testTypeFqName() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/typeFqName.kt"); + } + + @TestMetadata("unknownType.kt") + public void testUnknownType() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/unknownType.kt"); + } + + @TestMetadata("valWithDefaultGetter.kt") + public void testValWithDefaultGetter() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/valWithDefaultGetter.kt"); + } + + @TestMetadata("valWithGetter.kt") + public void testValWithGetter() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/valWithGetter.kt"); + } + + @TestMetadata("valWithGetterBlockBody.kt") + public void testValWithGetterBlockBody() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/valWithGetterBlockBody.kt"); + } + + @TestMetadata("varWithDefaultGetterAndSetter.kt") + public void testVarWithDefaultGetterAndSetter() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/varWithDefaultGetterAndSetter.kt"); + } + + @TestMetadata("varWithDefaultSetter.kt") + public void testVarWithDefaultSetter() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/varWithDefaultSetter.kt"); + } + + @TestMetadata("varWithGetter.kt") + public void testVarWithGetter() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/varWithGetter.kt"); + } + + @TestMetadata("varWithGetterAndSetter.kt") + public void testVarWithGetterAndSetter() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/varWithGetterAndSetter.kt"); + } + + @TestMetadata("varWithSetter.kt") + public void testVarWithSetter() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/varWithSetter.kt"); + } + + @TestMetadata("withType.kt") + public void testWithType() throws Exception { + doTest("idea/testData/intentions/declarations/convertMemberToExtension/withType.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/declarations/split") + public static class Split extends AbstractCodeTransformationTest { + public void testAllFilesPresentInSplit() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/declarations/split"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("longInit.kt") + public void testLongInit() throws Exception { + doTest("idea/testData/intentions/declarations/split/longInit.kt"); + } + + @TestMetadata("longInit2.kt") + public void testLongInit2() throws Exception { + doTest("idea/testData/intentions/declarations/split/longInit2.kt"); + } + + @TestMetadata("noInitializer.kt") + public void testNoInitializer() throws Exception { + doTest("idea/testData/intentions/declarations/split/noInitializer.kt"); + } + + @TestMetadata("noInitializer2.kt") + public void testNoInitializer2() throws Exception { + doTest("idea/testData/intentions/declarations/split/noInitializer2.kt"); + } + + @TestMetadata("nonLocalProperty.kt") + public void testNonLocalProperty() throws Exception { + doTest("idea/testData/intentions/declarations/split/nonLocalProperty.kt"); + } + + @TestMetadata("nonLocalProperty2.kt") + public void testNonLocalProperty2() throws Exception { + doTest("idea/testData/intentions/declarations/split/nonLocalProperty2.kt"); + } + + @TestMetadata("simpleInit.kt") + public void testSimpleInit() throws Exception { + doTest("idea/testData/intentions/declarations/split/simpleInit.kt"); + } + + @TestMetadata("simpleInit2.kt") + public void testSimpleInit2() throws Exception { + doTest("idea/testData/intentions/declarations/split/simpleInit2.kt"); + } + + @TestMetadata("simpleInitWithErrorType.kt") + public void testSimpleInitWithErrorType() throws Exception { + doTest("idea/testData/intentions/declarations/split/simpleInitWithErrorType.kt"); + } + + @TestMetadata("simpleInitWithErrorType2.kt") + public void testSimpleInitWithErrorType2() throws Exception { + doTest("idea/testData/intentions/declarations/split/simpleInitWithErrorType2.kt"); + } + + @TestMetadata("simpleInitWithType.kt") + public void testSimpleInitWithType() throws Exception { + doTest("idea/testData/intentions/declarations/split/simpleInitWithType.kt"); + } + + @TestMetadata("simpleInitWithType2.kt") + public void testSimpleInitWithType2() throws Exception { + doTest("idea/testData/intentions/declarations/split/simpleInitWithType2.kt"); + } + + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("Declarations"); + suite.addTestSuite(Declarations.class); + suite.addTestSuite(ConvertMemberToExtension.class); + suite.addTestSuite(Split.class); + return suite; + } + } + + @TestMetadata("idea/testData/intentions/insertCurlyBracesToTemplate") + public static class InsertCurlyBracesToTemplate extends AbstractCodeTransformationTest { + public void testAllFilesPresentInInsertCurlyBracesToTemplate() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/insertCurlyBracesToTemplate"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("dontInsertBrackets1.kt") + public void testDontInsertBrackets1() throws Exception { + doTest("idea/testData/intentions/insertCurlyBracesToTemplate/dontInsertBrackets1.kt"); + } + + @TestMetadata("insertBrackets1.kt") + public void testInsertBrackets1() throws Exception { + doTest("idea/testData/intentions/insertCurlyBracesToTemplate/insertBrackets1.kt"); + } + + @TestMetadata("insertBrackets2.kt") + public void testInsertBrackets2() throws Exception { + doTest("idea/testData/intentions/insertCurlyBracesToTemplate/insertBrackets2.kt"); + } + + @TestMetadata("insertBrackets3.kt") + public void testInsertBrackets3() throws Exception { + doTest("idea/testData/intentions/insertCurlyBracesToTemplate/insertBrackets3.kt"); + } + + @TestMetadata("insertBrackets4.kt") + public void testInsertBrackets4() throws Exception { + doTest("idea/testData/intentions/insertCurlyBracesToTemplate/insertBrackets4.kt"); + } + + @TestMetadata("insertBrackets5.kt") + public void testInsertBrackets5() throws Exception { + doTest("idea/testData/intentions/insertCurlyBracesToTemplate/insertBrackets5.kt"); } } @@ -3917,92 +3276,729 @@ public class CodeTransformationTestGenerated extends AbstractCodeTransformationT @TestMetadata("inapplicableAlreadyTyped.kt") public void testInapplicableAlreadyTyped() throws Exception { - doTestInsertExplicitTypeArguments("idea/testData/intentions/insertExplicitTypeArguments/inapplicableAlreadyTyped.kt"); + doTest("idea/testData/intentions/insertExplicitTypeArguments/inapplicableAlreadyTyped.kt"); } @TestMetadata("inapplicableNotGeneric.kt") public void testInapplicableNotGeneric() throws Exception { - doTestInsertExplicitTypeArguments("idea/testData/intentions/insertExplicitTypeArguments/inapplicableNotGeneric.kt"); + doTest("idea/testData/intentions/insertExplicitTypeArguments/inapplicableNotGeneric.kt"); } @TestMetadata("inapplicableNotInCallable.kt") public void testInapplicableNotInCallable() throws Exception { - doTestInsertExplicitTypeArguments("idea/testData/intentions/insertExplicitTypeArguments/inapplicableNotInCallable.kt"); + doTest("idea/testData/intentions/insertExplicitTypeArguments/inapplicableNotInCallable.kt"); } @TestMetadata("inapplicableNotInCallable2.kt") public void testInapplicableNotInCallable2() throws Exception { - doTestInsertExplicitTypeArguments("idea/testData/intentions/insertExplicitTypeArguments/inapplicableNotInCallable2.kt"); + doTest("idea/testData/intentions/insertExplicitTypeArguments/inapplicableNotInCallable2.kt"); } @TestMetadata("inapplicableTypeNotInferred.kt") public void testInapplicableTypeNotInferred() throws Exception { - doTestInsertExplicitTypeArguments("idea/testData/intentions/insertExplicitTypeArguments/inapplicableTypeNotInferred.kt"); + doTest("idea/testData/intentions/insertExplicitTypeArguments/inapplicableTypeNotInferred.kt"); } @TestMetadata("insertManyTypes.kt") public void testInsertManyTypes() throws Exception { - doTestInsertExplicitTypeArguments("idea/testData/intentions/insertExplicitTypeArguments/insertManyTypes.kt"); + doTest("idea/testData/intentions/insertExplicitTypeArguments/insertManyTypes.kt"); } @TestMetadata("insertManyTypesInDifferentOrder.kt") public void testInsertManyTypesInDifferentOrder() throws Exception { - doTestInsertExplicitTypeArguments("idea/testData/intentions/insertExplicitTypeArguments/insertManyTypesInDifferentOrder.kt"); + doTest("idea/testData/intentions/insertExplicitTypeArguments/insertManyTypesInDifferentOrder.kt"); } @TestMetadata("insertMultipleSomeWithClashingName.kt") public void testInsertMultipleSomeWithClashingName() throws Exception { - doTestInsertExplicitTypeArguments("idea/testData/intentions/insertExplicitTypeArguments/insertMultipleSomeWithClashingName.kt"); + doTest("idea/testData/intentions/insertExplicitTypeArguments/insertMultipleSomeWithClashingName.kt"); } @TestMetadata("insertTwoTypesFun.kt") public void testInsertTwoTypesFun() throws Exception { - doTestInsertExplicitTypeArguments("idea/testData/intentions/insertExplicitTypeArguments/insertTwoTypesFun.kt"); + doTest("idea/testData/intentions/insertExplicitTypeArguments/insertTwoTypesFun.kt"); } @TestMetadata("insertTypeAny.kt") public void testInsertTypeAny() throws Exception { - doTestInsertExplicitTypeArguments("idea/testData/intentions/insertExplicitTypeArguments/insertTypeAny.kt"); + doTest("idea/testData/intentions/insertExplicitTypeArguments/insertTypeAny.kt"); } @TestMetadata("insertTypeThatIsAFunction.kt") public void testInsertTypeThatIsAFunction() throws Exception { - doTestInsertExplicitTypeArguments("idea/testData/intentions/insertExplicitTypeArguments/insertTypeThatIsAFunction.kt"); + doTest("idea/testData/intentions/insertExplicitTypeArguments/insertTypeThatIsAFunction.kt"); } @TestMetadata("insertTypeThatIsATypeArg.kt") public void testInsertTypeThatIsATypeArg() throws Exception { - doTestInsertExplicitTypeArguments("idea/testData/intentions/insertExplicitTypeArguments/insertTypeThatIsATypeArg.kt"); + doTest("idea/testData/intentions/insertExplicitTypeArguments/insertTypeThatIsATypeArg.kt"); } @TestMetadata("insertTypeWithClashingName.kt") public void testInsertTypeWithClashingName() throws Exception { - doTestInsertExplicitTypeArguments("idea/testData/intentions/insertExplicitTypeArguments/insertTypeWithClashingName.kt"); + doTest("idea/testData/intentions/insertExplicitTypeArguments/insertTypeWithClashingName.kt"); } @TestMetadata("insertTypeWithLambda.kt") public void testInsertTypeWithLambda() throws Exception { - doTestInsertExplicitTypeArguments("idea/testData/intentions/insertExplicitTypeArguments/insertTypeWithLambda.kt"); + doTest("idea/testData/intentions/insertExplicitTypeArguments/insertTypeWithLambda.kt"); } @TestMetadata("insertTypeWithTypeArguments.kt") public void testInsertTypeWithTypeArguments() throws Exception { - doTestInsertExplicitTypeArguments("idea/testData/intentions/insertExplicitTypeArguments/insertTypeWithTypeArguments.kt"); + doTest("idea/testData/intentions/insertExplicitTypeArguments/insertTypeWithTypeArguments.kt"); } @TestMetadata("insertTypeWithVarargs.kt") public void testInsertTypeWithVarargs() throws Exception { - doTestInsertExplicitTypeArguments("idea/testData/intentions/insertExplicitTypeArguments/insertTypeWithVarargs.kt"); + doTest("idea/testData/intentions/insertExplicitTypeArguments/insertTypeWithVarargs.kt"); } @TestMetadata("simpleInsertTypeClass.kt") public void testSimpleInsertTypeClass() throws Exception { - doTestInsertExplicitTypeArguments("idea/testData/intentions/insertExplicitTypeArguments/simpleInsertTypeClass.kt"); + doTest("idea/testData/intentions/insertExplicitTypeArguments/simpleInsertTypeClass.kt"); } @TestMetadata("simpleInsertTypeFun.kt") public void testSimpleInsertTypeFun() throws Exception { - doTestInsertExplicitTypeArguments("idea/testData/intentions/insertExplicitTypeArguments/simpleInsertTypeFun.kt"); + doTest("idea/testData/intentions/insertExplicitTypeArguments/simpleInsertTypeFun.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/invertIfCondition") + public static class InvertIfCondition extends AbstractCodeTransformationTest { + public void testAllFilesPresentInInvertIfCondition() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/invertIfCondition"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("assignedToValue.kt") + public void testAssignedToValue() throws Exception { + doTest("idea/testData/intentions/invertIfCondition/assignedToValue.kt"); + } + + @TestMetadata("binaryExpression.kt") + public void testBinaryExpression() throws Exception { + doTest("idea/testData/intentions/invertIfCondition/binaryExpression.kt"); + } + + @TestMetadata("booleanLiteral.kt") + public void testBooleanLiteral() throws Exception { + doTest("idea/testData/intentions/invertIfCondition/booleanLiteral.kt"); + } + + @TestMetadata("branchingIfStatements.kt") + public void testBranchingIfStatements() throws Exception { + doTest("idea/testData/intentions/invertIfCondition/branchingIfStatements.kt"); + } + + @TestMetadata("forLoopWithMultipleExpressions.kt") + public void testForLoopWithMultipleExpressions() throws Exception { + doTest("idea/testData/intentions/invertIfCondition/forLoopWithMultipleExpressions.kt"); + } + + @TestMetadata("functionWithReturnExpression.kt") + public void testFunctionWithReturnExpression() throws Exception { + doTest("idea/testData/intentions/invertIfCondition/functionWithReturnExpression.kt"); + } + + @TestMetadata("ifExpressionInsideForLoop.kt") + public void testIfExpressionInsideForLoop() throws Exception { + doTest("idea/testData/intentions/invertIfCondition/ifExpressionInsideForLoop.kt"); + } + + @TestMetadata("ifExpressionWithReturn.kt") + public void testIfExpressionWithReturn() throws Exception { + doTest("idea/testData/intentions/invertIfCondition/ifExpressionWithReturn.kt"); + } + + @TestMetadata("invertableOperator.kt") + public void testInvertableOperator() throws Exception { + doTest("idea/testData/intentions/invertIfCondition/invertableOperator.kt"); + } + + @TestMetadata("negatedExpression.kt") + public void testNegatedExpression() throws Exception { + doTest("idea/testData/intentions/invertIfCondition/negatedExpression.kt"); + } + + @TestMetadata("returnIfExpression.kt") + public void testReturnIfExpression() throws Exception { + doTest("idea/testData/intentions/invertIfCondition/returnIfExpression.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + doTest("idea/testData/intentions/invertIfCondition/simple.kt"); + } + + @TestMetadata("valueAndReturnBranches.kt") + public void testValueAndReturnBranches() throws Exception { + doTest("idea/testData/intentions/invertIfCondition/valueAndReturnBranches.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/makeTypeExplicitInLambda") + public static class MakeTypeExplicitInLambda extends AbstractCodeTransformationTest { + public void testAllFilesPresentInMakeTypeExplicitInLambda() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/makeTypeExplicitInLambda"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("coercionToUnit.kt") + public void testCoercionToUnit() throws Exception { + doTest("idea/testData/intentions/makeTypeExplicitInLambda/coercionToUnit.kt"); + } + + @TestMetadata("emptyParamListWithBrackets.kt") + public void testEmptyParamListWithBrackets() throws Exception { + doTest("idea/testData/intentions/makeTypeExplicitInLambda/emptyParamListWithBrackets.kt"); + } + + @TestMetadata("emptyParamListWithIt.kt") + public void testEmptyParamListWithIt() throws Exception { + doTest("idea/testData/intentions/makeTypeExplicitInLambda/emptyParamListWithIt.kt"); + } + + @TestMetadata("emptyParamListWithWhiteSpace.kt") + public void testEmptyParamListWithWhiteSpace() throws Exception { + doTest("idea/testData/intentions/makeTypeExplicitInLambda/emptyParamListWithWhiteSpace.kt"); + } + + @TestMetadata("emptyParamListWithoutItWithArrow.kt") + public void testEmptyParamListWithoutItWithArrow() throws Exception { + doTest("idea/testData/intentions/makeTypeExplicitInLambda/emptyParamListWithoutItWithArrow.kt"); + } + + @TestMetadata("invalidCursorPosition.kt") + public void testInvalidCursorPosition() throws Exception { + doTest("idea/testData/intentions/makeTypeExplicitInLambda/invalidCursorPosition.kt"); + } + + @TestMetadata("lambdaWithLambdaAsParam.kt") + public void testLambdaWithLambdaAsParam() throws Exception { + doTest("idea/testData/intentions/makeTypeExplicitInLambda/lambdaWithLambdaAsParam.kt"); + } + + @TestMetadata("manyNewlines.kt") + public void testManyNewlines() throws Exception { + doTest("idea/testData/intentions/makeTypeExplicitInLambda/manyNewlines.kt"); + } + + @TestMetadata("multipleParam.kt") + public void testMultipleParam() throws Exception { + doTest("idea/testData/intentions/makeTypeExplicitInLambda/multipleParam.kt"); + } + + @TestMetadata("paramDeclaredReturnNotDeclared.kt") + public void testParamDeclaredReturnNotDeclared() throws Exception { + doTest("idea/testData/intentions/makeTypeExplicitInLambda/paramDeclaredReturnNotDeclared.kt"); + } + + @TestMetadata("returnDeclaredParamNotDeclared.kt") + public void testReturnDeclaredParamNotDeclared() throws Exception { + doTest("idea/testData/intentions/makeTypeExplicitInLambda/returnDeclaredParamNotDeclared.kt"); + } + + @TestMetadata("shortenReferencesForParams.kt") + public void testShortenReferencesForParams() throws Exception { + doTest("idea/testData/intentions/makeTypeExplicitInLambda/shortenReferencesForParams.kt"); + } + + @TestMetadata("shortenReferencesForReceiver.kt") + public void testShortenReferencesForReceiver() throws Exception { + doTest("idea/testData/intentions/makeTypeExplicitInLambda/shortenReferencesForReceiver.kt"); + } + + @TestMetadata("singleParam.kt") + public void testSingleParam() throws Exception { + doTest("idea/testData/intentions/makeTypeExplicitInLambda/singleParam.kt"); + } + + @TestMetadata("singleParamWithReceiver.kt") + public void testSingleParamWithReceiver() throws Exception { + doTest("idea/testData/intentions/makeTypeExplicitInLambda/singleParamWithReceiver.kt"); + } + + @TestMetadata("typesAlreadyExplicit.kt") + public void testTypesAlreadyExplicit() throws Exception { + doTest("idea/testData/intentions/makeTypeExplicitInLambda/typesAlreadyExplicit.kt"); + } + + @TestMetadata("typesNotInferable.kt") + public void testTypesNotInferable() throws Exception { + doTest("idea/testData/intentions/makeTypeExplicitInLambda/typesNotInferable.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/makeTypeImplicitInLambda") + public static class MakeTypeImplicitInLambda extends AbstractCodeTransformationTest { + public void testAllFilesPresentInMakeTypeImplicitInLambda() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/makeTypeImplicitInLambda"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("explicitReceiverType.kt") + public void testExplicitReceiverType() throws Exception { + doTest("idea/testData/intentions/makeTypeImplicitInLambda/explicitReceiverType.kt"); + } + + @TestMetadata("explicitReturnType.kt") + public void testExplicitReturnType() throws Exception { + doTest("idea/testData/intentions/makeTypeImplicitInLambda/explicitReturnType.kt"); + } + + @TestMetadata("invalidCursorPosition.kt") + public void testInvalidCursorPosition() throws Exception { + doTest("idea/testData/intentions/makeTypeImplicitInLambda/invalidCursorPosition.kt"); + } + + @TestMetadata("lambdaWithLambdaAsParam.kt") + public void testLambdaWithLambdaAsParam() throws Exception { + doTest("idea/testData/intentions/makeTypeImplicitInLambda/lambdaWithLambdaAsParam.kt"); + } + + @TestMetadata("multipleExplicitParams.kt") + public void testMultipleExplicitParams() throws Exception { + doTest("idea/testData/intentions/makeTypeImplicitInLambda/multipleExplicitParams.kt"); + } + + @TestMetadata("paramDeclaredReturnNotDeclared.kt") + public void testParamDeclaredReturnNotDeclared() throws Exception { + doTest("idea/testData/intentions/makeTypeImplicitInLambda/paramDeclaredReturnNotDeclared.kt"); + } + + @TestMetadata("returnDeclaredParamNotDeclared.kt") + public void testReturnDeclaredParamNotDeclared() throws Exception { + doTest("idea/testData/intentions/makeTypeImplicitInLambda/returnDeclaredParamNotDeclared.kt"); + } + + @TestMetadata("singleExplicitParam.kt") + public void testSingleExplicitParam() throws Exception { + doTest("idea/testData/intentions/makeTypeImplicitInLambda/singleExplicitParam.kt"); + } + + @TestMetadata("typesAlreadyImplicit.kt") + public void testTypesAlreadyImplicit() throws Exception { + doTest("idea/testData/intentions/makeTypeImplicitInLambda/typesAlreadyImplicit.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/moveLambdaInsideParentheses") + public static class MoveLambdaInsideParentheses extends AbstractCodeTransformationTest { + public void testAllFilesPresentInMoveLambdaInsideParentheses() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/moveLambdaInsideParentheses"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("inapplicable1.kt") + public void testInapplicable1() throws Exception { + doTest("idea/testData/intentions/moveLambdaInsideParentheses/inapplicable1.kt"); + } + + @TestMetadata("inapplicable2.kt") + public void testInapplicable2() throws Exception { + doTest("idea/testData/intentions/moveLambdaInsideParentheses/inapplicable2.kt"); + } + + @TestMetadata("moveLambda1.kt") + public void testMoveLambda1() throws Exception { + doTest("idea/testData/intentions/moveLambdaInsideParentheses/moveLambda1.kt"); + } + + @TestMetadata("moveLambda10.kt") + public void testMoveLambda10() throws Exception { + doTest("idea/testData/intentions/moveLambdaInsideParentheses/moveLambda10.kt"); + } + + @TestMetadata("moveLambda11.kt") + public void testMoveLambda11() throws Exception { + doTest("idea/testData/intentions/moveLambdaInsideParentheses/moveLambda11.kt"); + } + + @TestMetadata("moveLambda12.kt") + public void testMoveLambda12() throws Exception { + doTest("idea/testData/intentions/moveLambdaInsideParentheses/moveLambda12.kt"); + } + + @TestMetadata("moveLambda2.kt") + public void testMoveLambda2() throws Exception { + doTest("idea/testData/intentions/moveLambdaInsideParentheses/moveLambda2.kt"); + } + + @TestMetadata("moveLambda3.kt") + public void testMoveLambda3() throws Exception { + doTest("idea/testData/intentions/moveLambdaInsideParentheses/moveLambda3.kt"); + } + + @TestMetadata("moveLambda4.kt") + public void testMoveLambda4() throws Exception { + doTest("idea/testData/intentions/moveLambdaInsideParentheses/moveLambda4.kt"); + } + + @TestMetadata("moveLambda5.kt") + public void testMoveLambda5() throws Exception { + doTest("idea/testData/intentions/moveLambdaInsideParentheses/moveLambda5.kt"); + } + + @TestMetadata("moveLambda6.kt") + public void testMoveLambda6() throws Exception { + doTest("idea/testData/intentions/moveLambdaInsideParentheses/moveLambda6.kt"); + } + + @TestMetadata("moveLambda7.kt") + public void testMoveLambda7() throws Exception { + doTest("idea/testData/intentions/moveLambdaInsideParentheses/moveLambda7.kt"); + } + + @TestMetadata("moveLambda8.kt") + public void testMoveLambda8() throws Exception { + doTest("idea/testData/intentions/moveLambdaInsideParentheses/moveLambda8.kt"); + } + + @TestMetadata("moveLambda9.kt") + public void testMoveLambda9() throws Exception { + doTest("idea/testData/intentions/moveLambdaInsideParentheses/moveLambda9.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/moveLambdaOutsideParentheses") + public static class MoveLambdaOutsideParentheses extends AbstractCodeTransformationTest { + public void testAllFilesPresentInMoveLambdaOutsideParentheses() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/moveLambdaOutsideParentheses"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("inapplicable1.kt") + public void testInapplicable1() throws Exception { + doTest("idea/testData/intentions/moveLambdaOutsideParentheses/inapplicable1.kt"); + } + + @TestMetadata("inapplicable2.kt") + public void testInapplicable2() throws Exception { + doTest("idea/testData/intentions/moveLambdaOutsideParentheses/inapplicable2.kt"); + } + + @TestMetadata("inapplicable3.kt") + public void testInapplicable3() throws Exception { + doTest("idea/testData/intentions/moveLambdaOutsideParentheses/inapplicable3.kt"); + } + + @TestMetadata("labeledLambda.kt") + public void testLabeledLambda() throws Exception { + doTest("idea/testData/intentions/moveLambdaOutsideParentheses/labeledLambda.kt"); + } + + @TestMetadata("lambdaWithCommas.kt") + public void testLambdaWithCommas() throws Exception { + doTest("idea/testData/intentions/moveLambdaOutsideParentheses/lambdaWithCommas.kt"); + } + + @TestMetadata("lambdaWithCommas2.kt") + public void testLambdaWithCommas2() throws Exception { + doTest("idea/testData/intentions/moveLambdaOutsideParentheses/lambdaWithCommas2.kt"); + } + + @TestMetadata("lambdaWithCommas3.kt") + public void testLambdaWithCommas3() throws Exception { + doTest("idea/testData/intentions/moveLambdaOutsideParentheses/lambdaWithCommas3.kt"); + } + + @TestMetadata("moveLambda1.kt") + public void testMoveLambda1() throws Exception { + doTest("idea/testData/intentions/moveLambdaOutsideParentheses/moveLambda1.kt"); + } + + @TestMetadata("moveLambda2.kt") + public void testMoveLambda2() throws Exception { + doTest("idea/testData/intentions/moveLambdaOutsideParentheses/moveLambda2.kt"); + } + + @TestMetadata("moveLambda3.kt") + public void testMoveLambda3() throws Exception { + doTest("idea/testData/intentions/moveLambdaOutsideParentheses/moveLambda3.kt"); + } + + @TestMetadata("moveLambda4.kt") + public void testMoveLambda4() throws Exception { + doTest("idea/testData/intentions/moveLambdaOutsideParentheses/moveLambda4.kt"); + } + + @TestMetadata("moveLambda7.kt") + public void testMoveLambda7() throws Exception { + doTest("idea/testData/intentions/moveLambdaOutsideParentheses/moveLambda7.kt"); + } + + @TestMetadata("moveLambda8.kt") + public void testMoveLambda8() throws Exception { + doTest("idea/testData/intentions/moveLambdaOutsideParentheses/moveLambda8.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/operatorToFunction") + public static class OperatorToFunction extends AbstractCodeTransformationTest { + public void testAllFilesPresentInOperatorToFunction() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/operatorToFunction"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("arrayAccessMultipleIndex.kt") + public void testArrayAccessMultipleIndex() throws Exception { + doTest("idea/testData/intentions/operatorToFunction/arrayAccessMultipleIndex.kt"); + } + + @TestMetadata("arrayAccessOneIndex.kt") + public void testArrayAccessOneIndex() throws Exception { + doTest("idea/testData/intentions/operatorToFunction/arrayAccessOneIndex.kt"); + } + + @TestMetadata("arrayAssignmentMultipleIndex.kt") + public void testArrayAssignmentMultipleIndex() throws Exception { + doTest("idea/testData/intentions/operatorToFunction/arrayAssignmentMultipleIndex.kt"); + } + + @TestMetadata("binaryEqualsEqualsNullableOperands.kt") + public void testBinaryEqualsEqualsNullableOperands() throws Exception { + doTest("idea/testData/intentions/operatorToFunction/binaryEqualsEqualsNullableOperands.kt"); + } + + @TestMetadata("binaryNotEqualsNonNullableOperands.kt") + public void testBinaryNotEqualsNonNullableOperands() throws Exception { + doTest("idea/testData/intentions/operatorToFunction/binaryNotEqualsNonNullableOperands.kt"); + } + + @TestMetadata("binaryNotIn.kt") + public void testBinaryNotIn() throws Exception { + doTest("idea/testData/intentions/operatorToFunction/binaryNotIn.kt"); + } + + @TestMetadata("binaryPlus.kt") + public void testBinaryPlus() throws Exception { + doTest("idea/testData/intentions/operatorToFunction/binaryPlus.kt"); + } + + @TestMetadata("binaryPlusEquals.kt") + public void testBinaryPlusEquals() throws Exception { + doTest("idea/testData/intentions/operatorToFunction/binaryPlusEquals.kt"); + } + + @TestMetadata("binaryPlusEqualsNotResolved.kt") + public void testBinaryPlusEqualsNotResolved() throws Exception { + doTest("idea/testData/intentions/operatorToFunction/binaryPlusEqualsNotResolved.kt"); + } + + @TestMetadata("binaryRangeTo.kt") + public void testBinaryRangeTo() throws Exception { + doTest("idea/testData/intentions/operatorToFunction/binaryRangeTo.kt"); + } + + @TestMetadata("functionCallMultipleArgument.kt") + public void testFunctionCallMultipleArgument() throws Exception { + doTest("idea/testData/intentions/operatorToFunction/functionCallMultipleArgument.kt"); + } + + @TestMetadata("functionCallWithMultipleArgumentsAndSingleLambda.kt") + public void testFunctionCallWithMultipleArgumentsAndSingleLambda() throws Exception { + doTest("idea/testData/intentions/operatorToFunction/functionCallWithMultipleArgumentsAndSingleLambda.kt"); + } + + @TestMetadata("functionCallWithSingleLambda.kt") + public void testFunctionCallWithSingleLambda() throws Exception { + doTest("idea/testData/intentions/operatorToFunction/functionCallWithSingleLambda.kt"); + } + + @TestMetadata("notApplicableAssignment.kt") + public void testNotApplicableAssignment() throws Exception { + doTest("idea/testData/intentions/operatorToFunction/notApplicableAssignment.kt"); + } + + @TestMetadata("notApplicableCallWithInvokeMethod.kt") + public void testNotApplicableCallWithInvokeMethod() throws Exception { + doTest("idea/testData/intentions/operatorToFunction/notApplicableCallWithInvokeMethod.kt"); + } + + @TestMetadata("notApplicableFunctionCallWithCallableReference.kt") + public void testNotApplicableFunctionCallWithCallableReference() throws Exception { + doTest("idea/testData/intentions/operatorToFunction/notApplicableFunctionCallWithCallableReference.kt"); + } + + @TestMetadata("notApplicableNewClassObject.kt") + public void testNotApplicableNewClassObject() throws Exception { + doTest("idea/testData/intentions/operatorToFunction/notApplicableNewClassObject.kt"); + } + + @TestMetadata("postfixMinusMinus.kt") + public void testPostfixMinusMinus() throws Exception { + doTest("idea/testData/intentions/operatorToFunction/postfixMinusMinus.kt"); + } + + @TestMetadata("prefixPlus.kt") + public void testPrefixPlus() throws Exception { + doTest("idea/testData/intentions/operatorToFunction/prefixPlus.kt"); + } + + @TestMetadata("prefixPlusPlus.kt") + public void testPrefixPlusPlus() throws Exception { + doTest("idea/testData/intentions/operatorToFunction/prefixPlusPlus.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/reconstructedType") + public static class ReconstructedType extends AbstractCodeTransformationTest { + public void testAllFilesPresentInReconstructedType() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/reconstructedType"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("completeGenericType.kt") + public void testCompleteGenericType() throws Exception { + doTest("idea/testData/intentions/reconstructedType/completeGenericType.kt"); + } + + @TestMetadata("completeType.kt") + public void testCompleteType() throws Exception { + doTest("idea/testData/intentions/reconstructedType/completeType.kt"); + } + + @TestMetadata("errorType.kt") + public void testErrorType() throws Exception { + doTest("idea/testData/intentions/reconstructedType/errorType.kt"); + } + + @TestMetadata("reconstructableType.kt") + public void testReconstructableType() throws Exception { + doTest("idea/testData/intentions/reconstructedType/reconstructableType.kt"); + } + + @TestMetadata("typeInDeclaration.kt") + public void testTypeInDeclaration() throws Exception { + doTest("idea/testData/intentions/reconstructedType/typeInDeclaration.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/removeBraces") + public static class RemoveBraces extends AbstractCodeTransformationTest { + public void testAllFilesPresentInRemoveBraces() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/removeBraces"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("removeBracesForDoWhile.kt") + public void testRemoveBracesForDoWhile() throws Exception { + doTest("idea/testData/intentions/removeBraces/removeBracesForDoWhile.kt"); + } + + @TestMetadata("removeBracesForDoWhileWithTwoStatements.kt") + public void testRemoveBracesForDoWhileWithTwoStatements() throws Exception { + doTest("idea/testData/intentions/removeBraces/removeBracesForDoWhileWithTwoStatements.kt"); + } + + @TestMetadata("removeBracesForElse.kt") + public void testRemoveBracesForElse() throws Exception { + doTest("idea/testData/intentions/removeBraces/removeBracesForElse.kt"); + } + + @TestMetadata("removeBracesForFor.kt") + public void testRemoveBracesForFor() throws Exception { + doTest("idea/testData/intentions/removeBraces/removeBracesForFor.kt"); + } + + @TestMetadata("removeBracesForIf.kt") + public void testRemoveBracesForIf() throws Exception { + doTest("idea/testData/intentions/removeBraces/removeBracesForIf.kt"); + } + + @TestMetadata("removeBracesForIfWithComment.kt") + public void testRemoveBracesForIfWithComment() throws Exception { + doTest("idea/testData/intentions/removeBraces/removeBracesForIfWithComment.kt"); + } + + @TestMetadata("removeBracesForIfWithNoStatement.kt") + public void testRemoveBracesForIfWithNoStatement() throws Exception { + doTest("idea/testData/intentions/removeBraces/removeBracesForIfWithNoStatement.kt"); + } + + @TestMetadata("removeBracesForIfWithSemicolon.kt") + public void testRemoveBracesForIfWithSemicolon() throws Exception { + doTest("idea/testData/intentions/removeBraces/removeBracesForIfWithSemicolon.kt"); + } + + @TestMetadata("removeBracesForIfWithTwoStatements.kt") + public void testRemoveBracesForIfWithTwoStatements() throws Exception { + doTest("idea/testData/intentions/removeBraces/removeBracesForIfWithTwoStatements.kt"); + } + + @TestMetadata("removeBracesForWhile.kt") + public void testRemoveBracesForWhile() throws Exception { + doTest("idea/testData/intentions/removeBraces/removeBracesForWhile.kt"); + } + + @TestMetadata("removeBracesForWhileWithTwoStatements.kt") + public void testRemoveBracesForWhileWithTwoStatements() throws Exception { + doTest("idea/testData/intentions/removeBraces/removeBracesForWhileWithTwoStatements.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/removeCurlyBracesFromTemplate") + public static class RemoveCurlyBracesFromTemplate extends AbstractCodeTransformationTest { + public void testAllFilesPresentInRemoveCurlyBracesFromTemplate() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/removeCurlyBracesFromTemplate"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("necessaryBrackets1.kt") + public void testNecessaryBrackets1() throws Exception { + doTest("idea/testData/intentions/removeCurlyBracesFromTemplate/necessaryBrackets1.kt"); + } + + @TestMetadata("necessaryBrackets2.kt") + public void testNecessaryBrackets2() throws Exception { + doTest("idea/testData/intentions/removeCurlyBracesFromTemplate/necessaryBrackets2.kt"); + } + + @TestMetadata("necessaryBrackets3.kt") + public void testNecessaryBrackets3() throws Exception { + doTest("idea/testData/intentions/removeCurlyBracesFromTemplate/necessaryBrackets3.kt"); + } + + @TestMetadata("necessaryBrackets4.kt") + public void testNecessaryBrackets4() throws Exception { + doTest("idea/testData/intentions/removeCurlyBracesFromTemplate/necessaryBrackets4.kt"); + } + + @TestMetadata("necessaryBrackets5.kt") + public void testNecessaryBrackets5() throws Exception { + doTest("idea/testData/intentions/removeCurlyBracesFromTemplate/necessaryBrackets5.kt"); + } + + @TestMetadata("unnecessaryBrackets1.kt") + public void testUnnecessaryBrackets1() throws Exception { + doTest("idea/testData/intentions/removeCurlyBracesFromTemplate/unnecessaryBrackets1.kt"); + } + + @TestMetadata("unnecessaryBrackets2.kt") + public void testUnnecessaryBrackets2() throws Exception { + doTest("idea/testData/intentions/removeCurlyBracesFromTemplate/unnecessaryBrackets2.kt"); + } + + @TestMetadata("unnecessaryBrackets3.kt") + public void testUnnecessaryBrackets3() throws Exception { + doTest("idea/testData/intentions/removeCurlyBracesFromTemplate/unnecessaryBrackets3.kt"); + } + + @TestMetadata("unnecessaryBrackets4.kt") + public void testUnnecessaryBrackets4() throws Exception { + doTest("idea/testData/intentions/removeCurlyBracesFromTemplate/unnecessaryBrackets4.kt"); + } + + @TestMetadata("unnecessaryBrackets5.kt") + public void testUnnecessaryBrackets5() throws Exception { + doTest("idea/testData/intentions/removeCurlyBracesFromTemplate/unnecessaryBrackets5.kt"); + } + + @TestMetadata("unnecessaryBrackets6.kt") + public void testUnnecessaryBrackets6() throws Exception { + doTest("idea/testData/intentions/removeCurlyBracesFromTemplate/unnecessaryBrackets6.kt"); } } @@ -4016,97 +4012,97 @@ public class CodeTransformationTestGenerated extends AbstractCodeTransformationT @TestMetadata("fourLiterals.kt") public void testFourLiterals() throws Exception { - doTestRemoveExplicitTypeArguments("idea/testData/intentions/removeExplicitTypeArguments/fourLiterals.kt"); + doTest("idea/testData/intentions/removeExplicitTypeArguments/fourLiterals.kt"); } @TestMetadata("functionBodyIsCallWithUnnecessaryTypeArgs.kt") public void testFunctionBodyIsCallWithUnnecessaryTypeArgs() throws Exception { - doTestRemoveExplicitTypeArguments("idea/testData/intentions/removeExplicitTypeArguments/functionBodyIsCallWithUnnecessaryTypeArgs.kt"); + doTest("idea/testData/intentions/removeExplicitTypeArguments/functionBodyIsCallWithUnnecessaryTypeArgs.kt"); } @TestMetadata("inapplicableTypeThatIsAFunItCannotBeInferred.kt") public void testInapplicableTypeThatIsAFunItCannotBeInferred() throws Exception { - doTestRemoveExplicitTypeArguments("idea/testData/intentions/removeExplicitTypeArguments/inapplicableTypeThatIsAFunItCannotBeInferred.kt"); + doTest("idea/testData/intentions/removeExplicitTypeArguments/inapplicableTypeThatIsAFunItCannotBeInferred.kt"); } @TestMetadata("lambdaType.kt") public void testLambdaType() throws Exception { - doTestRemoveExplicitTypeArguments("idea/testData/intentions/removeExplicitTypeArguments/lambdaType.kt"); + doTest("idea/testData/intentions/removeExplicitTypeArguments/lambdaType.kt"); } @TestMetadata("literalAny.kt") public void testLiteralAny() throws Exception { - doTestRemoveExplicitTypeArguments("idea/testData/intentions/removeExplicitTypeArguments/literalAny.kt"); + doTest("idea/testData/intentions/removeExplicitTypeArguments/literalAny.kt"); } @TestMetadata("literalString.kt") public void testLiteralString() throws Exception { - doTestRemoveExplicitTypeArguments("idea/testData/intentions/removeExplicitTypeArguments/literalString.kt"); + doTest("idea/testData/intentions/removeExplicitTypeArguments/literalString.kt"); } @TestMetadata("literalStringWithClass.kt") public void testLiteralStringWithClass() throws Exception { - doTestRemoveExplicitTypeArguments("idea/testData/intentions/removeExplicitTypeArguments/literalStringWithClass.kt"); + doTest("idea/testData/intentions/removeExplicitTypeArguments/literalStringWithClass.kt"); } @TestMetadata("literalsWhenTypeArgHasTypeArg.kt") public void testLiteralsWhenTypeArgHasTypeArg() throws Exception { - doTestRemoveExplicitTypeArguments("idea/testData/intentions/removeExplicitTypeArguments/literalsWhenTypeArgHasTypeArg.kt"); + doTest("idea/testData/intentions/removeExplicitTypeArguments/literalsWhenTypeArgHasTypeArg.kt"); } @TestMetadata("nestedCall-KT-5028.kt") public void testNestedCall_KT_5028() throws Exception { - doTestRemoveExplicitTypeArguments("idea/testData/intentions/removeExplicitTypeArguments/nestedCall-KT-5028.kt"); + doTest("idea/testData/intentions/removeExplicitTypeArguments/nestedCall-KT-5028.kt"); } @TestMetadata("notApplicableNotEnoughtInfo.kt") public void testNotApplicableNotEnoughtInfo() throws Exception { - doTestRemoveExplicitTypeArguments("idea/testData/intentions/removeExplicitTypeArguments/notApplicableNotEnoughtInfo.kt"); + doTest("idea/testData/intentions/removeExplicitTypeArguments/notApplicableNotEnoughtInfo.kt"); } @TestMetadata("notApplicableSupertypeOfInferred.kt") public void testNotApplicableSupertypeOfInferred() throws Exception { - doTestRemoveExplicitTypeArguments("idea/testData/intentions/removeExplicitTypeArguments/notApplicableSupertypeOfInferred.kt"); + doTest("idea/testData/intentions/removeExplicitTypeArguments/notApplicableSupertypeOfInferred.kt"); } @TestMetadata("notApplicableSupertypeOfInferredClass.kt") public void testNotApplicableSupertypeOfInferredClass() throws Exception { - doTestRemoveExplicitTypeArguments("idea/testData/intentions/removeExplicitTypeArguments/notApplicableSupertypeOfInferredClass.kt"); + doTest("idea/testData/intentions/removeExplicitTypeArguments/notApplicableSupertypeOfInferredClass.kt"); } @TestMetadata("propertyInitializerIsCallWithUnnecessaryTypeArgs.kt") public void testPropertyInitializerIsCallWithUnnecessaryTypeArgs() throws Exception { - doTestRemoveExplicitTypeArguments("idea/testData/intentions/removeExplicitTypeArguments/propertyInitializerIsCallWithUnnecessaryTypeArgs.kt"); + doTest("idea/testData/intentions/removeExplicitTypeArguments/propertyInitializerIsCallWithUnnecessaryTypeArgs.kt"); } @TestMetadata("returnCallWithUnnecessaryTypeArgs.kt") public void testReturnCallWithUnnecessaryTypeArgs() throws Exception { - doTestRemoveExplicitTypeArguments("idea/testData/intentions/removeExplicitTypeArguments/returnCallWithUnnecessaryTypeArgs.kt"); + doTest("idea/testData/intentions/removeExplicitTypeArguments/returnCallWithUnnecessaryTypeArgs.kt"); } @TestMetadata("twoLiteralValues.kt") public void testTwoLiteralValues() throws Exception { - doTestRemoveExplicitTypeArguments("idea/testData/intentions/removeExplicitTypeArguments/twoLiteralValues.kt"); + doTest("idea/testData/intentions/removeExplicitTypeArguments/twoLiteralValues.kt"); } @TestMetadata("variableString.kt") public void testVariableString() throws Exception { - doTestRemoveExplicitTypeArguments("idea/testData/intentions/removeExplicitTypeArguments/variableString.kt"); + doTest("idea/testData/intentions/removeExplicitTypeArguments/variableString.kt"); } @TestMetadata("variableString2.kt") public void testVariableString2() throws Exception { - doTestRemoveExplicitTypeArguments("idea/testData/intentions/removeExplicitTypeArguments/variableString2.kt"); + doTest("idea/testData/intentions/removeExplicitTypeArguments/variableString2.kt"); } @TestMetadata("variableStringFartherScope.kt") public void testVariableStringFartherScope() throws Exception { - doTestRemoveExplicitTypeArguments("idea/testData/intentions/removeExplicitTypeArguments/variableStringFartherScope.kt"); + doTest("idea/testData/intentions/removeExplicitTypeArguments/variableStringFartherScope.kt"); } @TestMetadata("variablesAndLiterals.kt") public void testVariablesAndLiterals() throws Exception { - doTestRemoveExplicitTypeArguments("idea/testData/intentions/removeExplicitTypeArguments/variablesAndLiterals.kt"); + doTest("idea/testData/intentions/removeExplicitTypeArguments/variablesAndLiterals.kt"); } public static Test innerSuite() { @@ -4116,668 +4112,1059 @@ public class CodeTransformationTestGenerated extends AbstractCodeTransformationT } } - @TestMetadata("idea/testData/intentions/convertAssertToIf") - public static class ConvertAssertToIf extends AbstractCodeTransformationTest { - public void testAllFilesPresentInConvertAssertToIf() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/convertAssertToIf"), Pattern.compile("^(.+)\\.kt$"), true); + @TestMetadata("idea/testData/intentions/removeUnnecessaryParentheses") + public static class RemoveUnnecessaryParentheses extends AbstractCodeTransformationTest { + public void testAllFilesPresentInRemoveUnnecessaryParentheses() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/removeUnnecessaryParentheses"), Pattern.compile("^(.+)\\.kt$"), true); } - @TestMetadata("assertErrorOverloaded.kt") - public void testAssertErrorOverloaded() throws Exception { - doTestConvertAssertToIfWithThrowIntention("idea/testData/intentions/convertAssertToIf/assertErrorOverloaded.kt"); + @TestMetadata("necessaryParentheses1.kt") + public void testNecessaryParentheses1() throws Exception { + doTest("idea/testData/intentions/removeUnnecessaryParentheses/necessaryParentheses1.kt"); } - @TestMetadata("booleanCondition.kt") - public void testBooleanCondition() throws Exception { - doTestConvertAssertToIfWithThrowIntention("idea/testData/intentions/convertAssertToIf/booleanCondition.kt"); + @TestMetadata("necessaryParentheses2.kt") + public void testNecessaryParentheses2() throws Exception { + doTest("idea/testData/intentions/removeUnnecessaryParentheses/necessaryParentheses2.kt"); } - @TestMetadata("booleanConditionSimplified.kt") - public void testBooleanConditionSimplified() throws Exception { - doTestConvertAssertToIfWithThrowIntention("idea/testData/intentions/convertAssertToIf/booleanConditionSimplified.kt"); + @TestMetadata("necessaryParentheses3.kt") + public void testNecessaryParentheses3() throws Exception { + doTest("idea/testData/intentions/removeUnnecessaryParentheses/necessaryParentheses3.kt"); } - @TestMetadata("booleanConditionSimplified2.kt") - public void testBooleanConditionSimplified2() throws Exception { - doTestConvertAssertToIfWithThrowIntention("idea/testData/intentions/convertAssertToIf/booleanConditionSimplified2.kt"); + @TestMetadata("necessaryParentheses4.kt") + public void testNecessaryParentheses4() throws Exception { + doTest("idea/testData/intentions/removeUnnecessaryParentheses/necessaryParentheses4.kt"); } - @TestMetadata("booleanConditionWithVariables.kt") - public void testBooleanConditionWithVariables() throws Exception { - doTestConvertAssertToIfWithThrowIntention("idea/testData/intentions/convertAssertToIf/booleanConditionWithVariables.kt"); + @TestMetadata("necessaryParentheses5.kt") + public void testNecessaryParentheses5() throws Exception { + doTest("idea/testData/intentions/removeUnnecessaryParentheses/necessaryParentheses5.kt"); } - @TestMetadata("dotQualifiedCall.kt") - public void testDotQualifiedCall() throws Exception { - doTestConvertAssertToIfWithThrowIntention("idea/testData/intentions/convertAssertToIf/dotQualifiedCall.kt"); + @TestMetadata("unnecessaryParentheses1.kt") + public void testUnnecessaryParentheses1() throws Exception { + doTest("idea/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses1.kt"); } - @TestMetadata("functionCallCondition.kt") - public void testFunctionCallCondition() throws Exception { - doTestConvertAssertToIfWithThrowIntention("idea/testData/intentions/convertAssertToIf/functionCallCondition.kt"); + @TestMetadata("unnecessaryParentheses2.kt") + public void testUnnecessaryParentheses2() throws Exception { + doTest("idea/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses2.kt"); } - @TestMetadata("functionMessageInsideParentheses.kt") - public void testFunctionMessageInsideParentheses() throws Exception { - doTestConvertAssertToIfWithThrowIntention("idea/testData/intentions/convertAssertToIf/functionMessageInsideParentheses.kt"); + @TestMetadata("unnecessaryParentheses3.kt") + public void testUnnecessaryParentheses3() throws Exception { + doTest("idea/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses3.kt"); } - @TestMetadata("inapplicableAssertOverloaded.kt") - public void testInapplicableAssertOverloaded() throws Exception { - doTestConvertAssertToIfWithThrowIntention("idea/testData/intentions/convertAssertToIf/inapplicableAssertOverloaded.kt"); + @TestMetadata("unnecessaryParentheses4.kt") + public void testUnnecessaryParentheses4() throws Exception { + doTest("idea/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses4.kt"); } - @TestMetadata("inapplicableAssertOverloadedWithPackage.kt") - public void testInapplicableAssertOverloadedWithPackage() throws Exception { - doTestConvertAssertToIfWithThrowIntention("idea/testData/intentions/convertAssertToIf/inapplicableAssertOverloadedWithPackage.kt"); + @TestMetadata("unnecessaryParentheses5.kt") + public void testUnnecessaryParentheses5() throws Exception { + doTest("idea/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses5.kt"); } - @TestMetadata("inapplicableNoCondition.kt") - public void testInapplicableNoCondition() throws Exception { - doTestConvertAssertToIfWithThrowIntention("idea/testData/intentions/convertAssertToIf/inapplicableNoCondition.kt"); + @TestMetadata("unnecessaryParentheses6.kt") + public void testUnnecessaryParentheses6() throws Exception { + doTest("idea/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses6.kt"); } - @TestMetadata("lambdaMessageInsideParentheses.kt") - public void testLambdaMessageInsideParentheses() throws Exception { - doTestConvertAssertToIfWithThrowIntention("idea/testData/intentions/convertAssertToIf/lambdaMessageInsideParentheses.kt"); + @TestMetadata("unnecessaryParentheses7.kt") + public void testUnnecessaryParentheses7() throws Exception { + doTest("idea/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses7.kt"); } - @TestMetadata("lambdaMessageOutsideParentheses.kt") - public void testLambdaMessageOutsideParentheses() throws Exception { - doTestConvertAssertToIfWithThrowIntention("idea/testData/intentions/convertAssertToIf/lambdaMessageOutsideParentheses.kt"); - } - - @TestMetadata("lambdaVariable.kt") - public void testLambdaVariable() throws Exception { - doTestConvertAssertToIfWithThrowIntention("idea/testData/intentions/convertAssertToIf/lambdaVariable.kt"); - } - - @TestMetadata("noMessage.kt") - public void testNoMessage() throws Exception { - doTestConvertAssertToIfWithThrowIntention("idea/testData/intentions/convertAssertToIf/noMessage.kt"); - } - - @TestMetadata("parenthesizedCondition.kt") - public void testParenthesizedCondition() throws Exception { - doTestConvertAssertToIfWithThrowIntention("idea/testData/intentions/convertAssertToIf/parenthesizedCondition.kt"); - } - - @TestMetadata("simpleConvert.kt") - public void testSimpleConvert() throws Exception { - doTestConvertAssertToIfWithThrowIntention("idea/testData/intentions/convertAssertToIf/simpleConvert.kt"); - } - - @TestMetadata("stringVariable.kt") - public void testStringVariable() throws Exception { - doTestConvertAssertToIfWithThrowIntention("idea/testData/intentions/convertAssertToIf/stringVariable.kt"); + @TestMetadata("unnecessaryParentheses8.kt") + public void testUnnecessaryParentheses8() throws Exception { + doTest("idea/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses8.kt"); } } - @TestMetadata("idea/testData/intentions/convertIfToAssert") - public static class ConvertIfToAssert extends AbstractCodeTransformationTest { - public void testAllFilesPresentInConvertIfToAssert() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/convertIfToAssert"), Pattern.compile("^(.+)\\.kt$"), true); + @TestMetadata("idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt") + public static class ReplaceExplicitFunctionLiteralParamWithIt extends AbstractCodeTransformationTest { + public void testAllFilesPresentInReplaceExplicitFunctionLiteralParamWithIt() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt"), Pattern.compile("^(.+)\\.kt$"), true); } - @TestMetadata("assertOverloaded.kt") - public void testAssertOverloaded() throws Exception { - doTestConvertIfWithThrowToAssertIntention("idea/testData/intentions/convertIfToAssert/assertOverloaded.kt"); + @TestMetadata("applicable_cursofOverParamInInnerLiteral.kt") + public void testApplicable_cursofOverParamInInnerLiteral() throws Exception { + doTest("idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt/applicable_cursofOverParamInInnerLiteral.kt"); } - @TestMetadata("assertOverloaded2.kt") - public void testAssertOverloaded2() throws Exception { - doTestConvertIfWithThrowToAssertIntention("idea/testData/intentions/convertIfToAssert/assertOverloaded2.kt"); + @TestMetadata("applicable_cursorOverParameterDeclaration.kt") + public void testApplicable_cursorOverParameterDeclaration() throws Exception { + doTest("idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt/applicable_cursorOverParameterDeclaration.kt"); } - @TestMetadata("booleanCondition.kt") - public void testBooleanCondition() throws Exception { - doTestConvertIfWithThrowToAssertIntention("idea/testData/intentions/convertIfToAssert/booleanCondition.kt"); + @TestMetadata("applicable_cursorOverParameterUse.kt") + public void testApplicable_cursorOverParameterUse() throws Exception { + doTest("idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt/applicable_cursorOverParameterUse.kt"); } - @TestMetadata("dotQualifiedThrow.kt") - public void testDotQualifiedThrow() throws Exception { - doTestConvertIfWithThrowToAssertIntention("idea/testData/intentions/convertIfToAssert/dotQualifiedThrow.kt"); + @TestMetadata("applicable_formatsProperly.kt") + public void testApplicable_formatsProperly() throws Exception { + doTest("idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt/applicable_formatsProperly.kt"); } - @TestMetadata("inapplicableAssertionErrorOverloaded.kt") - public void testInapplicableAssertionErrorOverloaded() throws Exception { - doTestConvertIfWithThrowToAssertIntention("idea/testData/intentions/convertIfToAssert/inapplicableAssertionErrorOverloaded.kt"); + @TestMetadata("notApplicable_alreadyUsesImplicitIt.kt") + public void testNotApplicable_alreadyUsesImplicitIt() throws Exception { + doTest("idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt/notApplicable_alreadyUsesImplicitIt.kt"); } - @TestMetadata("inapplicableCauseSent.kt") - public void testInapplicableCauseSent() throws Exception { - doTestConvertIfWithThrowToAssertIntention("idea/testData/intentions/convertIfToAssert/inapplicableCauseSent.kt"); + @TestMetadata("notApplicable_hasMultipleParameters.kt") + public void testNotApplicable_hasMultipleParameters() throws Exception { + doTest("idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt/notApplicable_hasMultipleParameters.kt"); } - @TestMetadata("inapplicableHasElse.kt") - public void testInapplicableHasElse() throws Exception { - doTestConvertIfWithThrowToAssertIntention("idea/testData/intentions/convertIfToAssert/inapplicableHasElse.kt"); + @TestMetadata("notApplicable_notFunctionLiteralParameter.kt") + public void testNotApplicable_notFunctionLiteralParameter() throws Exception { + doTest("idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt/notApplicable_notFunctionLiteralParameter.kt"); } - @TestMetadata("inapplicableMoreThanSingleExpression.kt") - public void testInapplicableMoreThanSingleExpression() throws Exception { - doTestConvertIfWithThrowToAssertIntention("idea/testData/intentions/convertIfToAssert/inapplicableMoreThanSingleExpression.kt"); - } - - @TestMetadata("inapplicableMoreThanSingleExpression2.kt") - public void testInapplicableMoreThanSingleExpression2() throws Exception { - doTestConvertIfWithThrowToAssertIntention("idea/testData/intentions/convertIfToAssert/inapplicableMoreThanSingleExpression2.kt"); - } - - @TestMetadata("noMessageSent.kt") - public void testNoMessageSent() throws Exception { - doTestConvertIfWithThrowToAssertIntention("idea/testData/intentions/convertIfToAssert/noMessageSent.kt"); - } - - @TestMetadata("nullSent.kt") - public void testNullSent() throws Exception { - doTestConvertIfWithThrowToAssertIntention("idea/testData/intentions/convertIfToAssert/nullSent.kt"); - } - - @TestMetadata("simpleConvert.kt") - public void testSimpleConvert() throws Exception { - doTestConvertIfWithThrowToAssertIntention("idea/testData/intentions/convertIfToAssert/simpleConvert.kt"); - } - - @TestMetadata("simplifiedCondition.kt") - public void testSimplifiedCondition() throws Exception { - doTestConvertIfWithThrowToAssertIntention("idea/testData/intentions/convertIfToAssert/simplifiedCondition.kt"); + @TestMetadata("notApplicable_parameterHasExplicitType.kt") + public void testNotApplicable_parameterHasExplicitType() throws Exception { + doTest("idea/testData/intentions/replaceExplicitFunctionLiteralParamWithIt/notApplicable_parameterHasExplicitType.kt"); } } - @TestMetadata("idea/testData/intentions/makeTypeExplicitInLambda") - public static class MakeTypeExplicitInLambda extends AbstractCodeTransformationTest { - public void testAllFilesPresentInMakeTypeExplicitInLambda() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/makeTypeExplicitInLambda"), Pattern.compile("^(.+)\\.kt$"), true); + @TestMetadata("idea/testData/intentions/replaceItWithExplicitFunctionLiteralParam") + public static class ReplaceItWithExplicitFunctionLiteralParam extends AbstractCodeTransformationTest { + public void testAllFilesPresentInReplaceItWithExplicitFunctionLiteralParam() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/replaceItWithExplicitFunctionLiteralParam"), Pattern.compile("^(.+)\\.kt$"), true); } - @TestMetadata("coercionToUnit.kt") - public void testCoercionToUnit() throws Exception { - doTestMakeTypeExplicitInLambda("idea/testData/intentions/makeTypeExplicitInLambda/coercionToUnit.kt"); + @TestMetadata("applicable.kt") + public void testApplicable() throws Exception { + doTest("idea/testData/intentions/replaceItWithExplicitFunctionLiteralParam/applicable.kt"); } - @TestMetadata("emptyParamListWithBrackets.kt") - public void testEmptyParamListWithBrackets() throws Exception { - doTestMakeTypeExplicitInLambda("idea/testData/intentions/makeTypeExplicitInLambda/emptyParamListWithBrackets.kt"); + @TestMetadata("applicable_nestedFunctionLiterals.kt") + public void testApplicable_nestedFunctionLiterals() throws Exception { + doTest("idea/testData/intentions/replaceItWithExplicitFunctionLiteralParam/applicable_nestedFunctionLiterals.kt"); } - @TestMetadata("emptyParamListWithIt.kt") - public void testEmptyParamListWithIt() throws Exception { - doTestMakeTypeExplicitInLambda("idea/testData/intentions/makeTypeExplicitInLambda/emptyParamListWithIt.kt"); + @TestMetadata("applicable_nestedFunctionWithIt.kt") + public void testApplicable_nestedFunctionWithIt() throws Exception { + doTest("idea/testData/intentions/replaceItWithExplicitFunctionLiteralParam/applicable_nestedFunctionWithIt.kt"); } - @TestMetadata("emptyParamListWithWhiteSpace.kt") - public void testEmptyParamListWithWhiteSpace() throws Exception { - doTestMakeTypeExplicitInLambda("idea/testData/intentions/makeTypeExplicitInLambda/emptyParamListWithWhiteSpace.kt"); + @TestMetadata("notApplicable_localVariableIt.kt") + public void testNotApplicable_localVariableIt() throws Exception { + doTest("idea/testData/intentions/replaceItWithExplicitFunctionLiteralParam/notApplicable_localVariableIt.kt"); } - @TestMetadata("emptyParamListWithoutItWithArrow.kt") - public void testEmptyParamListWithoutItWithArrow() throws Exception { - doTestMakeTypeExplicitInLambda("idea/testData/intentions/makeTypeExplicitInLambda/emptyParamListWithoutItWithArrow.kt"); - } - - @TestMetadata("invalidCursorPosition.kt") - public void testInvalidCursorPosition() throws Exception { - doTestMakeTypeExplicitInLambda("idea/testData/intentions/makeTypeExplicitInLambda/invalidCursorPosition.kt"); - } - - @TestMetadata("lambdaWithLambdaAsParam.kt") - public void testLambdaWithLambdaAsParam() throws Exception { - doTestMakeTypeExplicitInLambda("idea/testData/intentions/makeTypeExplicitInLambda/lambdaWithLambdaAsParam.kt"); - } - - @TestMetadata("manyNewlines.kt") - public void testManyNewlines() throws Exception { - doTestMakeTypeExplicitInLambda("idea/testData/intentions/makeTypeExplicitInLambda/manyNewlines.kt"); - } - - @TestMetadata("multipleParam.kt") - public void testMultipleParam() throws Exception { - doTestMakeTypeExplicitInLambda("idea/testData/intentions/makeTypeExplicitInLambda/multipleParam.kt"); - } - - @TestMetadata("paramDeclaredReturnNotDeclared.kt") - public void testParamDeclaredReturnNotDeclared() throws Exception { - doTestMakeTypeExplicitInLambda("idea/testData/intentions/makeTypeExplicitInLambda/paramDeclaredReturnNotDeclared.kt"); - } - - @TestMetadata("returnDeclaredParamNotDeclared.kt") - public void testReturnDeclaredParamNotDeclared() throws Exception { - doTestMakeTypeExplicitInLambda("idea/testData/intentions/makeTypeExplicitInLambda/returnDeclaredParamNotDeclared.kt"); - } - - @TestMetadata("shortenReferencesForParams.kt") - public void testShortenReferencesForParams() throws Exception { - doTestMakeTypeExplicitInLambda("idea/testData/intentions/makeTypeExplicitInLambda/shortenReferencesForParams.kt"); - } - - @TestMetadata("shortenReferencesForReceiver.kt") - public void testShortenReferencesForReceiver() throws Exception { - doTestMakeTypeExplicitInLambda("idea/testData/intentions/makeTypeExplicitInLambda/shortenReferencesForReceiver.kt"); - } - - @TestMetadata("singleParam.kt") - public void testSingleParam() throws Exception { - doTestMakeTypeExplicitInLambda("idea/testData/intentions/makeTypeExplicitInLambda/singleParam.kt"); - } - - @TestMetadata("singleParamWithReceiver.kt") - public void testSingleParamWithReceiver() throws Exception { - doTestMakeTypeExplicitInLambda("idea/testData/intentions/makeTypeExplicitInLambda/singleParamWithReceiver.kt"); - } - - @TestMetadata("typesAlreadyExplicit.kt") - public void testTypesAlreadyExplicit() throws Exception { - doTestMakeTypeExplicitInLambda("idea/testData/intentions/makeTypeExplicitInLambda/typesAlreadyExplicit.kt"); - } - - @TestMetadata("typesNotInferable.kt") - public void testTypesNotInferable() throws Exception { - doTestMakeTypeExplicitInLambda("idea/testData/intentions/makeTypeExplicitInLambda/typesNotInferable.kt"); + @TestMetadata("notApplicable_parameterExplicitlyNamedIt.kt") + public void testNotApplicable_parameterExplicitlyNamedIt() throws Exception { + doTest("idea/testData/intentions/replaceItWithExplicitFunctionLiteralParam/notApplicable_parameterExplicitlyNamedIt.kt"); } } - @TestMetadata("idea/testData/intentions/makeTypeImplicitInLambda") - public static class MakeTypeImplicitInLambda extends AbstractCodeTransformationTest { - public void testAllFilesPresentInMakeTypeImplicitInLambda() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/makeTypeImplicitInLambda"), Pattern.compile("^(.+)\\.kt$"), true); + @TestMetadata("idea/testData/intentions/replaceWithDotQualifiedMethodCall") + public static class ReplaceWithDotQualifiedMethodCall extends AbstractCodeTransformationTest { + public void testAllFilesPresentInReplaceWithDotQualifiedMethodCall() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/replaceWithDotQualifiedMethodCall"), Pattern.compile("^(.+)\\.kt$"), true); } - @TestMetadata("explicitReceiverType.kt") - public void testExplicitReceiverType() throws Exception { - doTestMakeTypeImplicitInLambda("idea/testData/intentions/makeTypeImplicitInLambda/explicitReceiverType.kt"); + @TestMetadata("functionCallAfterInfixCall.kt") + public void testFunctionCallAfterInfixCall() throws Exception { + doTest("idea/testData/intentions/replaceWithDotQualifiedMethodCall/functionCallAfterInfixCall.kt"); } - @TestMetadata("explicitReturnType.kt") - public void testExplicitReturnType() throws Exception { - doTestMakeTypeImplicitInLambda("idea/testData/intentions/makeTypeImplicitInLambda/explicitReturnType.kt"); + @TestMetadata("functionLiteralArgument.kt") + public void testFunctionLiteralArgument() throws Exception { + doTest("idea/testData/intentions/replaceWithDotQualifiedMethodCall/functionLiteralArgument.kt"); } - @TestMetadata("invalidCursorPosition.kt") - public void testInvalidCursorPosition() throws Exception { - doTestMakeTypeImplicitInLambda("idea/testData/intentions/makeTypeImplicitInLambda/invalidCursorPosition.kt"); + @TestMetadata("nonApplicableBinaryOperation.kt") + public void testNonApplicableBinaryOperation() throws Exception { + doTest("idea/testData/intentions/replaceWithDotQualifiedMethodCall/nonApplicableBinaryOperation.kt"); } - @TestMetadata("lambdaWithLambdaAsParam.kt") - public void testLambdaWithLambdaAsParam() throws Exception { - doTestMakeTypeImplicitInLambda("idea/testData/intentions/makeTypeImplicitInLambda/lambdaWithLambdaAsParam.kt"); + @TestMetadata("nullAssertedCall.kt") + public void testNullAssertedCall() throws Exception { + doTest("idea/testData/intentions/replaceWithDotQualifiedMethodCall/nullAssertedCall.kt"); } - @TestMetadata("multipleExplicitParams.kt") - public void testMultipleExplicitParams() throws Exception { - doTestMakeTypeImplicitInLambda("idea/testData/intentions/makeTypeImplicitInLambda/multipleExplicitParams.kt"); + @TestMetadata("parenthesesAroundRightHandArgument.kt") + public void testParenthesesAroundRightHandArgument() throws Exception { + doTest("idea/testData/intentions/replaceWithDotQualifiedMethodCall/parenthesesAroundRightHandArgument.kt"); } - @TestMetadata("paramDeclaredReturnNotDeclared.kt") - public void testParamDeclaredReturnNotDeclared() throws Exception { - doTestMakeTypeImplicitInLambda("idea/testData/intentions/makeTypeImplicitInLambda/paramDeclaredReturnNotDeclared.kt"); - } - - @TestMetadata("returnDeclaredParamNotDeclared.kt") - public void testReturnDeclaredParamNotDeclared() throws Exception { - doTestMakeTypeImplicitInLambda("idea/testData/intentions/makeTypeImplicitInLambda/returnDeclaredParamNotDeclared.kt"); - } - - @TestMetadata("singleExplicitParam.kt") - public void testSingleExplicitParam() throws Exception { - doTestMakeTypeImplicitInLambda("idea/testData/intentions/makeTypeImplicitInLambda/singleExplicitParam.kt"); - } - - @TestMetadata("typesAlreadyImplicit.kt") - public void testTypesAlreadyImplicit() throws Exception { - doTestMakeTypeImplicitInLambda("idea/testData/intentions/makeTypeImplicitInLambda/typesAlreadyImplicit.kt"); + @TestMetadata("simpleInfixFunctionCall.kt") + public void testSimpleInfixFunctionCall() throws Exception { + doTest("idea/testData/intentions/replaceWithDotQualifiedMethodCall/simpleInfixFunctionCall.kt"); } } - @TestMetadata("idea/testData/intentions/invertIfCondition") - public static class InvertIfCondition extends AbstractCodeTransformationTest { - public void testAllFilesPresentInInvertIfCondition() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/invertIfCondition"), Pattern.compile("^(.+)\\.kt$"), true); + @TestMetadata("idea/testData/intentions/replaceWithInfixFunctionCall") + public static class ReplaceWithInfixFunctionCall extends AbstractCodeTransformationTest { + public void testAllFilesPresentInReplaceWithInfixFunctionCall() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/replaceWithInfixFunctionCall"), Pattern.compile("^(.+)\\.kt$"), true); } - @TestMetadata("assignedToValue.kt") - public void testAssignedToValue() throws Exception { - doTestInvertIfCondition("idea/testData/intentions/invertIfCondition/assignedToValue.kt"); + @TestMetadata("binaryExpressionArgument.kt") + public void testBinaryExpressionArgument() throws Exception { + doTest("idea/testData/intentions/replaceWithInfixFunctionCall/binaryExpressionArgument.kt"); } - @TestMetadata("binaryExpression.kt") - public void testBinaryExpression() throws Exception { - doTestInvertIfCondition("idea/testData/intentions/invertIfCondition/binaryExpression.kt"); + @TestMetadata("caretInsideCalleeExpr.kt") + public void testCaretInsideCalleeExpr() throws Exception { + doTest("idea/testData/intentions/replaceWithInfixFunctionCall/caretInsideCalleeExpr.kt"); } - @TestMetadata("booleanLiteral.kt") - public void testBooleanLiteral() throws Exception { - doTestInvertIfCondition("idea/testData/intentions/invertIfCondition/booleanLiteral.kt"); + @TestMetadata("caretInsideReceiverExpr.kt") + public void testCaretInsideReceiverExpr() throws Exception { + doTest("idea/testData/intentions/replaceWithInfixFunctionCall/caretInsideReceiverExpr.kt"); } - @TestMetadata("branchingIfStatements.kt") - public void testBranchingIfStatements() throws Exception { - doTestInvertIfCondition("idea/testData/intentions/invertIfCondition/branchingIfStatements.kt"); + @TestMetadata("doubleFunctionCall.kt") + public void testDoubleFunctionCall() throws Exception { + doTest("idea/testData/intentions/replaceWithInfixFunctionCall/doubleFunctionCall.kt"); } - @TestMetadata("forLoopWithMultipleExpressions.kt") - public void testForLoopWithMultipleExpressions() throws Exception { - doTestInvertIfCondition("idea/testData/intentions/invertIfCondition/forLoopWithMultipleExpressions.kt"); + @TestMetadata("doubleFunctionCallWithoutParentheses.kt") + public void testDoubleFunctionCallWithoutParentheses() throws Exception { + doTest("idea/testData/intentions/replaceWithInfixFunctionCall/doubleFunctionCallWithoutParentheses.kt"); } - @TestMetadata("functionWithReturnExpression.kt") - public void testFunctionWithReturnExpression() throws Exception { - doTestInvertIfCondition("idea/testData/intentions/invertIfCondition/functionWithReturnExpression.kt"); + @TestMetadata("firstParameterLabeled.kt") + public void testFirstParameterLabeled() throws Exception { + doTest("idea/testData/intentions/replaceWithInfixFunctionCall/firstParameterLabeled.kt"); } - @TestMetadata("ifExpressionInsideForLoop.kt") - public void testIfExpressionInsideForLoop() throws Exception { - doTestInvertIfCondition("idea/testData/intentions/invertIfCondition/ifExpressionInsideForLoop.kt"); + @TestMetadata("functionLiteralArgument.kt") + public void testFunctionLiteralArgument() throws Exception { + doTest("idea/testData/intentions/replaceWithInfixFunctionCall/functionLiteralArgument.kt"); } - @TestMetadata("ifExpressionWithReturn.kt") - public void testIfExpressionWithReturn() throws Exception { - doTestInvertIfCondition("idea/testData/intentions/invertIfCondition/ifExpressionWithReturn.kt"); + @TestMetadata("functionSafeCall.kt") + public void testFunctionSafeCall() throws Exception { + doTest("idea/testData/intentions/replaceWithInfixFunctionCall/functionSafeCall.kt"); } - @TestMetadata("invertableOperator.kt") - public void testInvertableOperator() throws Exception { - doTestInvertIfCondition("idea/testData/intentions/invertIfCondition/invertableOperator.kt"); + @TestMetadata("inapplicableCaretPosition.kt") + public void testInapplicableCaretPosition() throws Exception { + doTest("idea/testData/intentions/replaceWithInfixFunctionCall/inapplicableCaretPosition.kt"); } - @TestMetadata("negatedExpression.kt") - public void testNegatedExpression() throws Exception { - doTestInvertIfCondition("idea/testData/intentions/invertIfCondition/negatedExpression.kt"); + @TestMetadata("multipleArguments.kt") + public void testMultipleArguments() throws Exception { + doTest("idea/testData/intentions/replaceWithInfixFunctionCall/multipleArguments.kt"); } - @TestMetadata("returnIfExpression.kt") - public void testReturnIfExpression() throws Exception { - doTestInvertIfCondition("idea/testData/intentions/invertIfCondition/returnIfExpression.kt"); + @TestMetadata("namedArgument.kt") + public void testNamedArgument() throws Exception { + doTest("idea/testData/intentions/replaceWithInfixFunctionCall/namedArgument.kt"); } - @TestMetadata("simple.kt") - public void testSimple() throws Exception { - doTestInvertIfCondition("idea/testData/intentions/invertIfCondition/simple.kt"); + @TestMetadata("nullAssertedReceiver.kt") + public void testNullAssertedReceiver() throws Exception { + doTest("idea/testData/intentions/replaceWithInfixFunctionCall/nullAssertedReceiver.kt"); } - @TestMetadata("valueAndReturnBranches.kt") - public void testValueAndReturnBranches() throws Exception { - doTestInvertIfCondition("idea/testData/intentions/invertIfCondition/valueAndReturnBranches.kt"); + @TestMetadata("packageFunctionCall.kt") + public void testPackageFunctionCall() throws Exception { + doTest("idea/testData/intentions/replaceWithInfixFunctionCall/packageFunctionCall.kt"); } - } - - @TestMetadata("idea/testData/intentions/operatorToFunction") - public static class OperatorToFunction extends AbstractCodeTransformationTest { - public void testAllFilesPresentInOperatorToFunction() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/operatorToFunction"), Pattern.compile("^(.+)\\.kt$"), true); + @TestMetadata("propertyAccess.kt") + public void testPropertyAccess() throws Exception { + doTest("idea/testData/intentions/replaceWithInfixFunctionCall/propertyAccess.kt"); } - @TestMetadata("arrayAccessMultipleIndex.kt") - public void testArrayAccessMultipleIndex() throws Exception { - doTestOperatorToFunction("idea/testData/intentions/operatorToFunction/arrayAccessMultipleIndex.kt"); + @TestMetadata("secondParameterLabeled.kt") + public void testSecondParameterLabeled() throws Exception { + doTest("idea/testData/intentions/replaceWithInfixFunctionCall/secondParameterLabeled.kt"); } - @TestMetadata("arrayAccessOneIndex.kt") - public void testArrayAccessOneIndex() throws Exception { - doTestOperatorToFunction("idea/testData/intentions/operatorToFunction/arrayAccessOneIndex.kt"); + @TestMetadata("simpleArgumentAndFunctionLiteralArgument.kt") + public void testSimpleArgumentAndFunctionLiteralArgument() throws Exception { + doTest("idea/testData/intentions/replaceWithInfixFunctionCall/simpleArgumentAndFunctionLiteralArgument.kt"); } - @TestMetadata("arrayAssignmentMultipleIndex.kt") - public void testArrayAssignmentMultipleIndex() throws Exception { - doTestOperatorToFunction("idea/testData/intentions/operatorToFunction/arrayAssignmentMultipleIndex.kt"); + @TestMetadata("simpleMethodCall.kt") + public void testSimpleMethodCall() throws Exception { + doTest("idea/testData/intentions/replaceWithInfixFunctionCall/simpleMethodCall.kt"); } - @TestMetadata("binaryEqualsEqualsNullableOperands.kt") - public void testBinaryEqualsEqualsNullableOperands() throws Exception { - doTestOperatorToFunction("idea/testData/intentions/operatorToFunction/binaryEqualsEqualsNullableOperands.kt"); - } - - @TestMetadata("binaryNotEqualsNonNullableOperands.kt") - public void testBinaryNotEqualsNonNullableOperands() throws Exception { - doTestOperatorToFunction("idea/testData/intentions/operatorToFunction/binaryNotEqualsNonNullableOperands.kt"); - } - - @TestMetadata("binaryNotIn.kt") - public void testBinaryNotIn() throws Exception { - doTestOperatorToFunction("idea/testData/intentions/operatorToFunction/binaryNotIn.kt"); - } - - @TestMetadata("binaryPlus.kt") - public void testBinaryPlus() throws Exception { - doTestOperatorToFunction("idea/testData/intentions/operatorToFunction/binaryPlus.kt"); - } - - @TestMetadata("binaryPlusEquals.kt") - public void testBinaryPlusEquals() throws Exception { - doTestOperatorToFunction("idea/testData/intentions/operatorToFunction/binaryPlusEquals.kt"); - } - - @TestMetadata("binaryPlusEqualsNotResolved.kt") - public void testBinaryPlusEqualsNotResolved() throws Exception { - doTestOperatorToFunction("idea/testData/intentions/operatorToFunction/binaryPlusEqualsNotResolved.kt"); - } - - @TestMetadata("binaryRangeTo.kt") - public void testBinaryRangeTo() throws Exception { - doTestOperatorToFunction("idea/testData/intentions/operatorToFunction/binaryRangeTo.kt"); - } - - @TestMetadata("functionCallMultipleArgument.kt") - public void testFunctionCallMultipleArgument() throws Exception { - doTestOperatorToFunction("idea/testData/intentions/operatorToFunction/functionCallMultipleArgument.kt"); - } - - @TestMetadata("functionCallWithMultipleArgumentsAndSingleLambda.kt") - public void testFunctionCallWithMultipleArgumentsAndSingleLambda() throws Exception { - doTestOperatorToFunction("idea/testData/intentions/operatorToFunction/functionCallWithMultipleArgumentsAndSingleLambda.kt"); - } - - @TestMetadata("functionCallWithSingleLambda.kt") - public void testFunctionCallWithSingleLambda() throws Exception { - doTestOperatorToFunction("idea/testData/intentions/operatorToFunction/functionCallWithSingleLambda.kt"); - } - - @TestMetadata("notApplicableAssignment.kt") - public void testNotApplicableAssignment() throws Exception { - doTestOperatorToFunction("idea/testData/intentions/operatorToFunction/notApplicableAssignment.kt"); - } - - @TestMetadata("notApplicableCallWithInvokeMethod.kt") - public void testNotApplicableCallWithInvokeMethod() throws Exception { - doTestOperatorToFunction("idea/testData/intentions/operatorToFunction/notApplicableCallWithInvokeMethod.kt"); - } - - @TestMetadata("notApplicableFunctionCallWithCallableReference.kt") - public void testNotApplicableFunctionCallWithCallableReference() throws Exception { - doTestOperatorToFunction("idea/testData/intentions/operatorToFunction/notApplicableFunctionCallWithCallableReference.kt"); - } - - @TestMetadata("notApplicableNewClassObject.kt") - public void testNotApplicableNewClassObject() throws Exception { - doTestOperatorToFunction("idea/testData/intentions/operatorToFunction/notApplicableNewClassObject.kt"); - } - - @TestMetadata("postfixMinusMinus.kt") - public void testPostfixMinusMinus() throws Exception { - doTestOperatorToFunction("idea/testData/intentions/operatorToFunction/postfixMinusMinus.kt"); - } - - @TestMetadata("prefixPlus.kt") - public void testPrefixPlus() throws Exception { - doTestOperatorToFunction("idea/testData/intentions/operatorToFunction/prefixPlus.kt"); - } - - @TestMetadata("prefixPlusPlus.kt") - public void testPrefixPlusPlus() throws Exception { - doTestOperatorToFunction("idea/testData/intentions/operatorToFunction/prefixPlusPlus.kt"); - } - - } - - @TestMetadata("idea/testData/intentions/convertToForEachLoop") - public static class ConvertToForEachLoop extends AbstractCodeTransformationTest { - public void testAllFilesPresentInConvertToForEachLoop() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/convertToForEachLoop"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("complexReceiver.kt") - public void testComplexReceiver() throws Exception { - doTestConvertToForEachLoop("idea/testData/intentions/convertToForEachLoop/complexReceiver.kt"); - } - - @TestMetadata("explicitFunctionLiteral.kt") - public void testExplicitFunctionLiteral() throws Exception { - doTestConvertToForEachLoop("idea/testData/intentions/convertToForEachLoop/explicitFunctionLiteral.kt"); - } - - @TestMetadata("extraArguments.kt") - public void testExtraArguments() throws Exception { - doTestConvertToForEachLoop("idea/testData/intentions/convertToForEachLoop/extraArguments.kt"); - } - - @TestMetadata("implicitFunctionLiteralParameter.kt") - public void testImplicitFunctionLiteralParameter() throws Exception { - doTestConvertToForEachLoop("idea/testData/intentions/convertToForEachLoop/implicitFunctionLiteralParameter.kt"); - } - - @TestMetadata("infixCall.kt") - public void testInfixCall() throws Exception { - doTestConvertToForEachLoop("idea/testData/intentions/convertToForEachLoop/infixCall.kt"); - } - - @TestMetadata("parenthesizedExpression.kt") - public void testParenthesizedExpression() throws Exception { - doTestConvertToForEachLoop("idea/testData/intentions/convertToForEachLoop/parenthesizedExpression.kt"); - } - - @TestMetadata("simple.kt") - public void testSimple() throws Exception { - doTestConvertToForEachLoop("idea/testData/intentions/convertToForEachLoop/simple.kt"); - } - - @TestMetadata("typeArgumentPresent.kt") - public void testTypeArgumentPresent() throws Exception { - doTestConvertToForEachLoop("idea/testData/intentions/convertToForEachLoop/typeArgumentPresent.kt"); - } - - @TestMetadata("userDefined.kt") - public void testUserDefined() throws Exception { - doTestConvertToForEachLoop("idea/testData/intentions/convertToForEachLoop/userDefined.kt"); + @TestMetadata("singlePackageFunctionCall.kt") + public void testSinglePackageFunctionCall() throws Exception { + doTest("idea/testData/intentions/replaceWithInfixFunctionCall/singlePackageFunctionCall.kt"); } @TestMetadata("zeroArguments.kt") public void testZeroArguments() throws Exception { - doTestConvertToForEachLoop("idea/testData/intentions/convertToForEachLoop/zeroArguments.kt"); + doTest("idea/testData/intentions/replaceWithInfixFunctionCall/zeroArguments.kt"); } } - @TestMetadata("idea/testData/intentions/convertToForEachFunctionCall") - public static class ConvertToForEachFunctionCall extends AbstractCodeTransformationTest { - public void testAllFilesPresentInConvertToForEachFunctionCall() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/convertToForEachFunctionCall"), Pattern.compile("^(.+)\\.kt$"), true); + @TestMetadata("idea/testData/intentions/replaceWithOperatorAssign") + public static class ReplaceWithOperatorAssign extends AbstractCodeTransformationTest { + public void testAllFilesPresentInReplaceWithOperatorAssign() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/replaceWithOperatorAssign"), Pattern.compile("^(.+)\\.kt$"), true); } - @TestMetadata("binaryExpressionLoopRange.kt") - public void testBinaryExpressionLoopRange() throws Exception { - doTestConvertToForEachFunctionCall("idea/testData/intentions/convertToForEachFunctionCall/binaryExpressionLoopRange.kt"); + @TestMetadata("illegalMultipleOperators.kt") + public void testIllegalMultipleOperators() throws Exception { + doTest("idea/testData/intentions/replaceWithOperatorAssign/illegalMultipleOperators.kt"); } - @TestMetadata("blockBodyExpression.kt") - public void testBlockBodyExpression() throws Exception { - doTestConvertToForEachFunctionCall("idea/testData/intentions/convertToForEachFunctionCall/blockBodyExpression.kt"); + @TestMetadata("illegalMultipleOperatorsMiddle.kt") + public void testIllegalMultipleOperatorsMiddle() throws Exception { + doTest("idea/testData/intentions/replaceWithOperatorAssign/illegalMultipleOperatorsMiddle.kt"); } - @TestMetadata("iterativeElementTypeSpecified.kt") - public void testIterativeElementTypeSpecified() throws Exception { - doTestConvertToForEachFunctionCall("idea/testData/intentions/convertToForEachFunctionCall/iterativeElementTypeSpecified.kt"); + @TestMetadata("invalidSubtraction.kt") + public void testInvalidSubtraction() throws Exception { + doTest("idea/testData/intentions/replaceWithOperatorAssign/invalidSubtraction.kt"); } - @TestMetadata("noCurlyBraces.kt") - public void testNoCurlyBraces() throws Exception { - doTestConvertToForEachFunctionCall("idea/testData/intentions/convertToForEachFunctionCall/noCurlyBraces.kt"); + @TestMetadata("multipleOperators.kt") + public void testMultipleOperators() throws Exception { + doTest("idea/testData/intentions/replaceWithOperatorAssign/multipleOperators.kt"); } - @TestMetadata("noStatements.kt") - public void testNoStatements() throws Exception { - doTestConvertToForEachFunctionCall("idea/testData/intentions/convertToForEachFunctionCall/noStatements.kt"); + @TestMetadata("multipleOperatorsRightSideRepeat.kt") + public void testMultipleOperatorsRightSideRepeat() throws Exception { + doTest("idea/testData/intentions/replaceWithOperatorAssign/multipleOperatorsRightSideRepeat.kt"); + } + + @TestMetadata("nonRepeatingAssignment.kt") + public void testNonRepeatingAssignment() throws Exception { + doTest("idea/testData/intentions/replaceWithOperatorAssign/nonRepeatingAssignment.kt"); + } + + @TestMetadata("rightSideRepeat.kt") + public void testRightSideRepeat() throws Exception { + doTest("idea/testData/intentions/replaceWithOperatorAssign/rightSideRepeat.kt"); + } + + @TestMetadata("simpleAssign.kt") + public void testSimpleAssign() throws Exception { + doTest("idea/testData/intentions/replaceWithOperatorAssign/simpleAssign.kt"); + } + + @TestMetadata("validSubtraction.kt") + public void testValidSubtraction() throws Exception { + doTest("idea/testData/intentions/replaceWithOperatorAssign/validSubtraction.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/replaceWithTraditionalAssignment") + public static class ReplaceWithTraditionalAssignment extends AbstractCodeTransformationTest { + public void testAllFilesPresentInReplaceWithTraditionalAssignment() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/replaceWithTraditionalAssignment"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("complexRightExpression.kt") + public void testComplexRightExpression() throws Exception { + doTest("idea/testData/intentions/replaceWithTraditionalAssignment/complexRightExpression.kt"); + } + + @TestMetadata("nonAssignmentExpression.kt") + public void testNonAssignmentExpression() throws Exception { + doTest("idea/testData/intentions/replaceWithTraditionalAssignment/nonAssignmentExpression.kt"); + } + + @TestMetadata("nonAugmentedAssign.kt") + public void testNonAugmentedAssign() throws Exception { + doTest("idea/testData/intentions/replaceWithTraditionalAssignment/nonAugmentedAssign.kt"); } @TestMetadata("simple.kt") public void testSimple() throws Exception { - doTestConvertToForEachFunctionCall("idea/testData/intentions/convertToForEachFunctionCall/simple.kt"); + doTest("idea/testData/intentions/replaceWithTraditionalAssignment/simple.kt"); } - @TestMetadata("typeAnnotatedWithNonBlockBody.kt") - public void testTypeAnnotatedWithNonBlockBody() throws Exception { - doTestConvertToForEachFunctionCall("idea/testData/intentions/convertToForEachFunctionCall/typeAnnotatedWithNonBlockBody.kt"); + } + + @TestMetadata("idea/testData/intentions/simplifyBooleanWithConstants") + public static class SimplifyBooleanWithConstants extends AbstractCodeTransformationTest { + public void testAllFilesPresentInSimplifyBooleanWithConstants() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/simplifyBooleanWithConstants"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("inapplicableNoConstants.kt") + public void testInapplicableNoConstants() throws Exception { + doTest("idea/testData/intentions/simplifyBooleanWithConstants/inapplicableNoConstants.kt"); + } + + @TestMetadata("inapplicableNotBinary.kt") + public void testInapplicableNotBinary() throws Exception { + doTest("idea/testData/intentions/simplifyBooleanWithConstants/inapplicableNotBinary.kt"); + } + + @TestMetadata("inapplicableUsesVals.kt") + public void testInapplicableUsesVals() throws Exception { + doTest("idea/testData/intentions/simplifyBooleanWithConstants/inapplicableUsesVals.kt"); + } + + @TestMetadata("inapplicableUsesVals2.kt") + public void testInapplicableUsesVals2() throws Exception { + doTest("idea/testData/intentions/simplifyBooleanWithConstants/inapplicableUsesVals2.kt"); + } + + @TestMetadata("inapplicableUsesVals3.kt") + public void testInapplicableUsesVals3() throws Exception { + doTest("idea/testData/intentions/simplifyBooleanWithConstants/inapplicableUsesVals3.kt"); + } + + @TestMetadata("reduceableBinary.kt") + public void testReduceableBinary() throws Exception { + doTest("idea/testData/intentions/simplifyBooleanWithConstants/reduceableBinary.kt"); + } + + @TestMetadata("reduceableBinary2.kt") + public void testReduceableBinary2() throws Exception { + doTest("idea/testData/intentions/simplifyBooleanWithConstants/reduceableBinary2.kt"); + } + + @TestMetadata("reduceableBinary3.kt") + public void testReduceableBinary3() throws Exception { + doTest("idea/testData/intentions/simplifyBooleanWithConstants/reduceableBinary3.kt"); + } + + @TestMetadata("reduceableBinaryWithParenthese.kt") + public void testReduceableBinaryWithParenthese() throws Exception { + doTest("idea/testData/intentions/simplifyBooleanWithConstants/reduceableBinaryWithParenthese.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + doTest("idea/testData/intentions/simplifyBooleanWithConstants/simple.kt"); + } + + @TestMetadata("simpleWithMoreBinaries.kt") + public void testSimpleWithMoreBinaries() throws Exception { + doTest("idea/testData/intentions/simplifyBooleanWithConstants/simpleWithMoreBinaries.kt"); + } + + @TestMetadata("simpleWithMoreBinaries2.kt") + public void testSimpleWithMoreBinaries2() throws Exception { + doTest("idea/testData/intentions/simplifyBooleanWithConstants/simpleWithMoreBinaries2.kt"); + } + + @TestMetadata("simpleWithMoreBinaries3.kt") + public void testSimpleWithMoreBinaries3() throws Exception { + doTest("idea/testData/intentions/simplifyBooleanWithConstants/simpleWithMoreBinaries3.kt"); + } + + @TestMetadata("simpleWithMoreBinariesAndParentheses.kt") + public void testSimpleWithMoreBinariesAndParentheses() throws Exception { + doTest("idea/testData/intentions/simplifyBooleanWithConstants/simpleWithMoreBinariesAndParentheses.kt"); + } + + @TestMetadata("simpleWithMoreBinariesAndParentheses2.kt") + public void testSimpleWithMoreBinariesAndParentheses2() throws Exception { + doTest("idea/testData/intentions/simplifyBooleanWithConstants/simpleWithMoreBinariesAndParentheses2.kt"); + } + + @TestMetadata("simpleWithMoreBinariesAndParentheses3.kt") + public void testSimpleWithMoreBinariesAndParentheses3() throws Exception { + doTest("idea/testData/intentions/simplifyBooleanWithConstants/simpleWithMoreBinariesAndParentheses3.kt"); + } + + @TestMetadata("simpleWithNonsensical2.kt") + public void testSimpleWithNonsensical2() throws Exception { + doTest("idea/testData/intentions/simplifyBooleanWithConstants/simpleWithNonsensical2.kt"); + } + + @TestMetadata("simpleWithParentheses.kt") + public void testSimpleWithParentheses() throws Exception { + doTest("idea/testData/intentions/simplifyBooleanWithConstants/simpleWithParentheses.kt"); + } + + @TestMetadata("simpleWithParentheses2.kt") + public void testSimpleWithParentheses2() throws Exception { + doTest("idea/testData/intentions/simplifyBooleanWithConstants/simpleWithParentheses2.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention") + @InnerTestClasses({}) + public static class SimplifyNegatedBinaryExpressionIntention extends AbstractCodeTransformationTest { + public void testAllFilesPresentInSimplifyNegatedBinaryExpressionIntention() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("equals.kt") + public void testEquals() throws Exception { + doTest("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/equals.kt"); + } + + @TestMetadata("greaterThan.kt") + public void testGreaterThan() throws Exception { + doTest("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/greaterThan.kt"); + } + + @TestMetadata("greaterThanOrEquals.kt") + public void testGreaterThanOrEquals() throws Exception { + doTest("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/greaterThanOrEquals.kt"); + } + + @TestMetadata("in.kt") + public void testIn() throws Exception { + doTest("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/in.kt"); + } + + @TestMetadata("inapplicableBinaryOperation.kt") + public void testInapplicableBinaryOperation() throws Exception { + doTest("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/inapplicableBinaryOperation.kt"); + } + + @TestMetadata("is.kt") + public void testIs() throws Exception { + doTest("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/is.kt"); + } + + @TestMetadata("lessThan.kt") + public void testLessThan() throws Exception { + doTest("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/lessThan.kt"); + } + + @TestMetadata("lessThanOrEquals.kt") + public void testLessThanOrEquals() throws Exception { + doTest("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/lessThanOrEquals.kt"); + } + + @TestMetadata("notEquals.kt") + public void testNotEquals() throws Exception { + doTest("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/notEquals.kt"); + } + + @TestMetadata("notIn.kt") + public void testNotIn() throws Exception { + doTest("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/notIn.kt"); + } + + @TestMetadata("notIs.kt") + public void testNotIs() throws Exception { + doTest("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/notIs.kt"); + } + + @TestMetadata("simpleInvert.kt") + public void testSimpleInvert() throws Exception { + doTest("idea/testData/intentions/simplifyNegatedBinaryExpressionIntention/simpleInvert.kt"); + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("SimplifyNegatedBinaryExpressionIntention"); + suite.addTestSuite(SimplifyNegatedBinaryExpressionIntention.class); + return suite; + } + } + + @TestMetadata("idea/testData/intentions/specifyType") + public static class SpecifyType extends AbstractCodeTransformationTest { + public void testAllFilesPresentInSpecifyType() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/specifyType"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("badCaretPosition.kt") + public void testBadCaretPosition() throws Exception { + doTest("idea/testData/intentions/specifyType/badCaretPosition.kt"); + } + + @TestMetadata("classNameClashing.kt") + public void testClassNameClashing() throws Exception { + doTest("idea/testData/intentions/specifyType/classNameClashing.kt"); + } + + @TestMetadata("enumType.kt") + public void testEnumType() throws Exception { + doTest("idea/testData/intentions/specifyType/enumType.kt"); + } + + @TestMetadata("functionType.kt") + public void testFunctionType() throws Exception { + doTest("idea/testData/intentions/specifyType/functionType.kt"); + } + + @TestMetadata("loopParameter.kt") + public void testLoopParameter() throws Exception { + doTest("idea/testData/intentions/specifyType/loopParameter.kt"); + } + + @TestMetadata("onType.kt") + public void testOnType() throws Exception { + doTest("idea/testData/intentions/specifyType/onType.kt"); + } + + @TestMetadata("publicMember.kt") + public void testPublicMember() throws Exception { + doTest("idea/testData/intentions/specifyType/publicMember.kt"); + } + + @TestMetadata("removeUnresolvedType.kt") + public void testRemoveUnresolvedType() throws Exception { + doTest("idea/testData/intentions/specifyType/removeUnresolvedType.kt"); + } + + @TestMetadata("stringRedefined.kt") + public void testStringRedefined() throws Exception { + doTest("idea/testData/intentions/specifyType/stringRedefined.kt"); + } + + @TestMetadata("typeAlreadyProvided.kt") + public void testTypeAlreadyProvided() throws Exception { + doTest("idea/testData/intentions/specifyType/typeAlreadyProvided.kt"); + } + + @TestMetadata("unitType.kt") + public void testUnitType() throws Exception { + doTest("idea/testData/intentions/specifyType/unitType.kt"); + } + + @TestMetadata("unknownType.kt") + public void testUnknownType() throws Exception { + doTest("idea/testData/intentions/specifyType/unknownType.kt"); + } + + } + + @TestMetadata("idea/testData/intentions/splitIf") + public static class SplitIf extends AbstractCodeTransformationTest { + public void testAllFilesPresentInSplitIf() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/splitIf"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("splitIfAndOr.kt") + public void testSplitIfAndOr() throws Exception { + doTest("idea/testData/intentions/splitIf/splitIfAndOr.kt"); + } + + @TestMetadata("splitIfAndOrWithBraces.kt") + public void testSplitIfAndOrWithBraces() throws Exception { + doTest("idea/testData/intentions/splitIf/splitIfAndOrWithBraces.kt"); + } + + @TestMetadata("splitIfAndWithBraces.kt") + public void testSplitIfAndWithBraces() throws Exception { + doTest("idea/testData/intentions/splitIf/splitIfAndWithBraces.kt"); + } + + @TestMetadata("splitIfCaretOnIf.kt") + public void testSplitIfCaretOnIf() throws Exception { + doTest("idea/testData/intentions/splitIf/splitIfCaretOnIf.kt"); + } + + @TestMetadata("splitIfNestedIf.kt") + public void testSplitIfNestedIf() throws Exception { + doTest("idea/testData/intentions/splitIf/splitIfNestedIf.kt"); + } + + @TestMetadata("splitIfNestedIfNotApplicable.kt") + public void testSplitIfNestedIfNotApplicable() throws Exception { + doTest("idea/testData/intentions/splitIf/splitIfNestedIfNotApplicable.kt"); + } + + @TestMetadata("splitIfNestedInside.kt") + public void testSplitIfNestedInside() throws Exception { + doTest("idea/testData/intentions/splitIf/splitIfNestedInside.kt"); + } + + @TestMetadata("splitIfNestedOutside.kt") + public void testSplitIfNestedOutside() throws Exception { + doTest("idea/testData/intentions/splitIf/splitIfNestedOutside.kt"); + } + + @TestMetadata("splitIfNotIf.kt") + public void testSplitIfNotIf() throws Exception { + doTest("idea/testData/intentions/splitIf/splitIfNotIf.kt"); + } + + @TestMetadata("splitIfOnIfWithOr.kt") + public void testSplitIfOnIfWithOr() throws Exception { + doTest("idea/testData/intentions/splitIf/splitIfOnIfWithOr.kt"); + } + + @TestMetadata("splitIfOneAND.kt") + public void testSplitIfOneAND() throws Exception { + doTest("idea/testData/intentions/splitIf/splitIfOneAND.kt"); + } + + @TestMetadata("splitIfOperatorAsFunctionParam.kt") + public void testSplitIfOperatorAsFunctionParam() throws Exception { + doTest("idea/testData/intentions/splitIf/splitIfOperatorAsFunctionParam.kt"); + } + + @TestMetadata("splitIfOperatorOutsideIf.kt") + public void testSplitIfOperatorOutsideIf() throws Exception { + doTest("idea/testData/intentions/splitIf/splitIfOperatorOutsideIf.kt"); + } + + @TestMetadata("splitIfOrAnd.kt") + public void testSplitIfOrAnd() throws Exception { + doTest("idea/testData/intentions/splitIf/splitIfOrAnd.kt"); + } + + @TestMetadata("splitIfOrWithBraces.kt") + public void testSplitIfOrWithBraces() throws Exception { + doTest("idea/testData/intentions/splitIf/splitIfOrWithBraces.kt"); + } + + @TestMetadata("splitIfTwoOperatorsFirst.kt") + public void testSplitIfTwoOperatorsFirst() throws Exception { + doTest("idea/testData/intentions/splitIf/splitIfTwoOperatorsFirst.kt"); + } + + @TestMetadata("splitIfTwoOperatorsSecond.kt") + public void testSplitIfTwoOperatorsSecond() throws Exception { + doTest("idea/testData/intentions/splitIf/splitIfTwoOperatorsSecond.kt"); + } + + @TestMetadata("splitIfWithElse.kt") + public void testSplitIfWithElse() throws Exception { + doTest("idea/testData/intentions/splitIf/splitIfWithElse.kt"); + } + + @TestMetadata("splitIfWithFunction.kt") + public void testSplitIfWithFunction() throws Exception { + doTest("idea/testData/intentions/splitIf/splitIfWithFunction.kt"); + } + + @TestMetadata("splitIfWithNotOperator.kt") + public void testSplitIfWithNotOperator() throws Exception { + doTest("idea/testData/intentions/splitIf/splitIfWithNotOperator.kt"); + } + + @TestMetadata("splitIfWithNotOperatorGood.kt") + public void testSplitIfWithNotOperatorGood() throws Exception { + doTest("idea/testData/intentions/splitIf/splitIfWithNotOperatorGood.kt"); + } + + @TestMetadata("splitIfWithOR.kt") + public void testSplitIfWithOR() throws Exception { + doTest("idea/testData/intentions/splitIf/splitIfWithOR.kt"); + } + + @TestMetadata("splitIfWithORElse.kt") + public void testSplitIfWithORElse() throws Exception { + doTest("idea/testData/intentions/splitIf/splitIfWithORElse.kt"); + } + + @TestMetadata("splitIfWrongCaretLocation.kt") + public void testSplitIfWrongCaretLocation() throws Exception { + doTest("idea/testData/intentions/splitIf/splitIfWrongCaretLocation.kt"); + } + + } + + @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("assignment.kt") + public void testAssignment() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/assignment.kt"); + } + + @TestMetadata("compareTo.kt") + public void testCompareTo() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/compareTo.kt"); + } + + @TestMetadata("conjunction.kt") + public void testConjunction() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/conjunction.kt"); + } + + @TestMetadata("conjunctionLiteral.kt") + public void testConjunctionLiteral() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/conjunctionLiteral.kt"); + } + + @TestMetadata("disjunction.kt") + public void testDisjunction() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/disjunction.kt"); + } + + @TestMetadata("disjunctionLiteral.kt") + public void testDisjunctionLiteral() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/disjunctionLiteral.kt"); + } + + @TestMetadata("divide.kt") + public void testDivide() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/divide.kt"); + } + + @TestMetadata("divideAssign.kt") + public void testDivideAssign() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/divideAssign.kt"); + } + + @TestMetadata("divideLiteral.kt") + public void testDivideLiteral() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/divideLiteral.kt"); + } + + @TestMetadata("equals.kt") + public void testEquals() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/equals.kt"); + } + + @TestMetadata("equalsLiteral.kt") + public void testEqualsLiteral() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/equalsLiteral.kt"); + } + + @TestMetadata("greaterThan.kt") + public void testGreaterThan() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/greaterThan.kt"); + } + + @TestMetadata("greaterThanEquals.kt") + public void testGreaterThanEquals() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/greaterThanEquals.kt"); + } + + @TestMetadata("identityEquals.kt") + public void testIdentityEquals() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/identityEquals.kt"); + } + + @TestMetadata("identityEqualsLiteral.kt") + public void testIdentityEqualsLiteral() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/identityEqualsLiteral.kt"); + } + + @TestMetadata("in.kt") + public void testIn() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/in.kt"); + } + + @TestMetadata("infixFunction.kt") + public void testInfixFunction() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/infixFunction.kt"); + } + + @TestMetadata("is.kt") + public void testIs() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/is.kt"); + } + + @TestMetadata("lessThan.kt") + public void testLessThan() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/lessThan.kt"); + } + + @TestMetadata("lessThanEquals.kt") + public void testLessThanEquals() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/lessThanEquals.kt"); + } + + @TestMetadata("minus.kt") + public void testMinus() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/minus.kt"); + } + + @TestMetadata("minusAssign.kt") + public void testMinusAssign() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/minusAssign.kt"); + } + + @TestMetadata("minusLiteral.kt") + public void testMinusLiteral() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/minusLiteral.kt"); + } + + @TestMetadata("multipleOperands.kt") + public void testMultipleOperands() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/multipleOperands.kt"); + } + + @TestMetadata("multipleOperandsWithDifferentPrecedence.kt") + public void testMultipleOperandsWithDifferentPrecedence() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/multipleOperandsWithDifferentPrecedence.kt"); + } + + @TestMetadata("multipleOperandsWithDifferentPrecedence2.kt") + public void testMultipleOperandsWithDifferentPrecedence2() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/multipleOperandsWithDifferentPrecedence2.kt"); + } + + @TestMetadata("multipleOperandsWithDifferentPrecedence3.kt") + public void testMultipleOperandsWithDifferentPrecedence3() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/multipleOperandsWithDifferentPrecedence3.kt"); + } + + @TestMetadata("multipleOperandsWithDifferentPrecedence4.kt") + public void testMultipleOperandsWithDifferentPrecedence4() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/multipleOperandsWithDifferentPrecedence4.kt"); + } + + @TestMetadata("multipleOperandsWithDifferentPrecedence5.kt") + public void testMultipleOperandsWithDifferentPrecedence5() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/multipleOperandsWithDifferentPrecedence5.kt"); + } + + @TestMetadata("multipleOperandsWithDifferentPrecedence6.kt") + public void testMultipleOperandsWithDifferentPrecedence6() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/multipleOperandsWithDifferentPrecedence6.kt"); + } + + @TestMetadata("multiply.kt") + public void testMultiply() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/multiply.kt"); + } + + @TestMetadata("multiplyAssign.kt") + public void testMultiplyAssign() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/multiplyAssign.kt"); + } + + @TestMetadata("nonBinaryExpr.kt") + public void testNonBinaryExpr() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/nonBinaryExpr.kt"); + } + + @TestMetadata("notEquals.kt") + public void testNotEquals() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/notEquals.kt"); + } + + @TestMetadata("notIdentityEquals.kt") + public void testNotIdentityEquals() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/notIdentityEquals.kt"); + } + + @TestMetadata("notIn.kt") + public void testNotIn() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/notIn.kt"); + } + + @TestMetadata("notIs.kt") + public void testNotIs() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/notIs.kt"); + } + + @TestMetadata("nullOperand.kt") + public void testNullOperand() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/nullOperand.kt"); + } + + @TestMetadata("plus.kt") + public void testPlus() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/plus.kt"); + } + + @TestMetadata("plusAssign.kt") + public void testPlusAssign() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/plusAssign.kt"); + } + + @TestMetadata("plusInt.kt") + public void testPlusInt() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/plusInt.kt"); + } + + @TestMetadata("plusLiteral.kt") + public void testPlusLiteral() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/plusLiteral.kt"); + } + + @TestMetadata("plusMinus.kt") + public void testPlusMinus() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/plusMinus.kt"); + } + + @TestMetadata("rangeTo.kt") + public void testRangeTo() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/rangeTo.kt"); + } + + @TestMetadata("rangeToLiteral.kt") + public void testRangeToLiteral() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/rangeToLiteral.kt"); + } + + @TestMetadata("remainder.kt") + public void testRemainder() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/remainder.kt"); + } + + @TestMetadata("remainderAssign.kt") + public void testRemainderAssign() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/remainderAssign.kt"); + } + + @TestMetadata("times.kt") + public void testTimes() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/times.kt"); + } + + @TestMetadata("timesAssign.kt") + public void testTimesAssign() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/timesAssign.kt"); + } + + @TestMetadata("timesLiteral.kt") + public void testTimesLiteral() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/timesLiteral.kt"); + } + + @TestMetadata("xor.kt") + public void testXor() throws Exception { + doTest("idea/testData/intentions/swapBinaryExpression/xor.kt"); } } public static Test suite() { TestSuite suite = new TestSuite("CodeTransformationTestGenerated"); - suite.addTestSuite(DoubleBangToIfThen.class); - suite.addTestSuite(IfThenToDoubleBang.class); - suite.addTestSuite(ElvisToIfThen.class); - suite.addTest(IfThenToElvis.innerSuite()); - suite.addTestSuite(SafeAccessToIfThen.class); - suite.addTest(IfThenToSafeAccess.innerSuite()); - suite.addTestSuite(IfToAssignment.class); - suite.addTestSuite(IfToReturn.class); - suite.addTestSuite(IfToReturnAsymmetrically.class); - suite.addTestSuite(WhenToAssignment.class); - suite.addTestSuite(WhenToReturn.class); - suite.addTestSuite(AssignmentToIf.class); - suite.addTestSuite(AssignmentToWhen.class); - suite.addTestSuite(PropertyToIf.class); - suite.addTestSuite(PropertyToWhen.class); - suite.addTestSuite(ReturnToIf.class); - suite.addTestSuite(ReturnToWhen.class); - suite.addTestSuite(IfToWhen.class); - suite.addTestSuite(WhenToIf.class); - suite.addTestSuite(Flatten.class); - suite.addTestSuite(Merge.class); - suite.addTestSuite(IntroduceSubject.class); - suite.addTestSuite(EliminateSubject.class); - suite.addTestSuite(Split.class); - suite.addTestSuite(ConvertMemberToExtension.class); - suite.addTestSuite(ReconstructedType.class); - suite.addTestSuite(RemoveUnnecessaryParentheses.class); - suite.addTestSuite(ReplaceWithDotQualifiedMethodCall.class); - suite.addTestSuite(ReplaceWithInfixFunctionCall.class); - suite.addTestSuite(RemoveCurlyBracesFromTemplate.class); - suite.addTestSuite(ConvertToStringTemplateIntention.class); - suite.addTestSuite(ConvertToConcatenatedStringIntention.class); - suite.addTestSuite(MoveLambdaInsideParentheses.class); - suite.addTestSuite(MoveLambdaOutsideParentheses.class); - suite.addTestSuite(ReplaceExplicitFunctionLiteralParamWithIt.class); - suite.addTestSuite(ReplaceItWithExplicitFunctionLiteralParam.class); - suite.addTestSuite(RemoveBraces.class); + suite.addTestSuite(CodeTransformationTestGenerated.class); suite.addTestSuite(AddBraces.class); - suite.addTest(ReplaceGetIntention.innerSuite()); - suite.addTestSuite(ReplaceContainsIntention.class); - suite.addTestSuite(ReplaceBinaryInfixIntention.class); - suite.addTestSuite(ReplaceUnaryPrefixIntention.class); - suite.addTestSuite(ReplaceInvokeIntention.class); - suite.addTest(SimplifyNegatedBinaryExpressionIntention.innerSuite()); + suite.addTest(AttributeCallReplacements.innerSuite()); + suite.addTest(Branched.innerSuite()); + suite.addTestSuite(ConvertAssertToIf.class); + suite.addTestSuite(ConvertIfToAssert.class); suite.addTestSuite(ConvertNegatedBooleanSequence.class); suite.addTestSuite(ConvertNegatedExpressionWithDemorgansLaw.class); - suite.addTestSuite(SwapBinaryExpression.class); - suite.addTestSuite(SplitIf.class); + suite.addTestSuite(ConvertToBlockBody.class); + suite.addTestSuite(ConvertToConcatenatedStringIntention.class); + suite.addTestSuite(ConvertToExpressionBody.class); + suite.addTestSuite(ConvertToForEachFunctionCall.class); + suite.addTestSuite(ConvertToForEachLoop.class); + suite.addTestSuite(ConvertToStringTemplateIntention.class); + suite.addTest(Declarations.innerSuite()); + suite.addTestSuite(InsertCurlyBracesToTemplate.class); + suite.addTestSuite(InsertExplicitTypeArguments.class); + suite.addTestSuite(InvertIfCondition.class); + suite.addTestSuite(MakeTypeExplicitInLambda.class); + suite.addTestSuite(MakeTypeImplicitInLambda.class); + suite.addTestSuite(MoveLambdaInsideParentheses.class); + suite.addTestSuite(MoveLambdaOutsideParentheses.class); + suite.addTestSuite(OperatorToFunction.class); + suite.addTestSuite(ReconstructedType.class); + suite.addTestSuite(RemoveBraces.class); + suite.addTestSuite(RemoveCurlyBracesFromTemplate.class); + suite.addTest(RemoveExplicitTypeArguments.innerSuite()); + suite.addTestSuite(RemoveUnnecessaryParentheses.class); + suite.addTestSuite(ReplaceExplicitFunctionLiteralParamWithIt.class); + suite.addTestSuite(ReplaceItWithExplicitFunctionLiteralParam.class); + suite.addTestSuite(ReplaceWithDotQualifiedMethodCall.class); + suite.addTestSuite(ReplaceWithInfixFunctionCall.class); suite.addTestSuite(ReplaceWithOperatorAssign.class); suite.addTestSuite(ReplaceWithTraditionalAssignment.class); suite.addTestSuite(SimplifyBooleanWithConstants.class); - suite.addTestSuite(InsertExplicitTypeArguments.class); - suite.addTest(RemoveExplicitTypeArguments.innerSuite()); - suite.addTestSuite(ConvertAssertToIf.class); - suite.addTestSuite(ConvertIfToAssert.class); - suite.addTestSuite(MakeTypeExplicitInLambda.class); - suite.addTestSuite(MakeTypeImplicitInLambda.class); - suite.addTestSuite(InvertIfCondition.class); - suite.addTestSuite(OperatorToFunction.class); - suite.addTestSuite(ConvertToForEachLoop.class); - suite.addTestSuite(ConvertToForEachFunctionCall.class); + suite.addTest(SimplifyNegatedBinaryExpressionIntention.innerSuite()); + suite.addTestSuite(SpecifyType.class); + suite.addTestSuite(SplitIf.class); + suite.addTestSuite(SwapBinaryExpression.class); return suite; } } diff --git a/idea/tests/org/jetbrains/jet/plugin/intentions/ConvertToBlockBodyTestGenerated.java b/idea/tests/org/jetbrains/jet/plugin/intentions/ConvertToBlockBodyTestGenerated.java deleted file mode 100644 index a27985ee716..00000000000 --- a/idea/tests/org/jetbrains/jet/plugin/intentions/ConvertToBlockBodyTestGenerated.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 2010-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -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.AbstractIntentionTest; - -/** This class is generated by {@link org.jetbrains.jet.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ -@SuppressWarnings("all") -@TestMetadata("idea/testData/intentions/convertToBlockBody") -public class ConvertToBlockBodyTestGenerated extends AbstractIntentionTest { - public void testAllFilesPresentInConvertToBlockBody() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/convertToBlockBody"), Pattern.compile("^before(\\w+)\\.kt$"), true); - } - - @TestMetadata("beforeExplicitlyNonUnitFun.kt") - public void testExplicitlyNonUnitFun() throws Exception { - doTest("idea/testData/intentions/convertToBlockBody/beforeExplicitlyNonUnitFun.kt"); - } - - @TestMetadata("beforeExplicitlyTypedFunWithUnresolvedExpression.kt") - public void testExplicitlyTypedFunWithUnresolvedExpression() throws Exception { - doTest("idea/testData/intentions/convertToBlockBody/beforeExplicitlyTypedFunWithUnresolvedExpression.kt"); - } - - @TestMetadata("beforeExplicitlyTypedFunWithUnresolvedType.kt") - public void testExplicitlyTypedFunWithUnresolvedType() throws Exception { - doTest("idea/testData/intentions/convertToBlockBody/beforeExplicitlyTypedFunWithUnresolvedType.kt"); - } - - @TestMetadata("beforeExplicitlyUnitFun.kt") - public void testExplicitlyUnitFun() throws Exception { - doTest("idea/testData/intentions/convertToBlockBody/beforeExplicitlyUnitFun.kt"); - } - - @TestMetadata("beforeExplicitlyUnitFunWithUnresolvedExpression.kt") - public void testExplicitlyUnitFunWithUnresolvedExpression() throws Exception { - doTest("idea/testData/intentions/convertToBlockBody/beforeExplicitlyUnitFunWithUnresolvedExpression.kt"); - } - - @TestMetadata("beforeFunWithThrow.kt") - public void testFunWithThrow() throws Exception { - doTest("idea/testData/intentions/convertToBlockBody/beforeFunWithThrow.kt"); - } - - @TestMetadata("beforeGetter.kt") - public void testGetter() throws Exception { - doTest("idea/testData/intentions/convertToBlockBody/beforeGetter.kt"); - } - - @TestMetadata("beforeGetterWithThrow.kt") - public void testGetterWithThrow() throws Exception { - doTest("idea/testData/intentions/convertToBlockBody/beforeGetterWithThrow.kt"); - } - - @TestMetadata("beforeImplicitlyNonUnitFun.kt") - public void testImplicitlyNonUnitFun() throws Exception { - doTest("idea/testData/intentions/convertToBlockBody/beforeImplicitlyNonUnitFun.kt"); - } - - @TestMetadata("beforeImplicitlyTypedFunWithUnresolvedType.kt") - public void testImplicitlyTypedFunWithUnresolvedType() throws Exception { - doTest("idea/testData/intentions/convertToBlockBody/beforeImplicitlyTypedFunWithUnresolvedType.kt"); - } - - @TestMetadata("beforeImplicitlyUnitFun.kt") - public void testImplicitlyUnitFun() throws Exception { - doTest("idea/testData/intentions/convertToBlockBody/beforeImplicitlyUnitFun.kt"); - } - - @TestMetadata("beforeNothingFun.kt") - public void testNothingFun() throws Exception { - doTest("idea/testData/intentions/convertToBlockBody/beforeNothingFun.kt"); - } - - @TestMetadata("beforeSetter.kt") - public void testSetter() throws Exception { - doTest("idea/testData/intentions/convertToBlockBody/beforeSetter.kt"); - } - -} diff --git a/idea/tests/org/jetbrains/jet/plugin/intentions/ConvertToExpressionBodyTestGenerated.java b/idea/tests/org/jetbrains/jet/plugin/intentions/ConvertToExpressionBodyTestGenerated.java deleted file mode 100644 index 865c1af1cd8..00000000000 --- a/idea/tests/org/jetbrains/jet/plugin/intentions/ConvertToExpressionBodyTestGenerated.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright 2010-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -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.AbstractIntentionTest; - -/** This class is generated by {@link org.jetbrains.jet.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ -@SuppressWarnings("all") -@TestMetadata("idea/testData/intentions/convertToExpressionBody") -public class ConvertToExpressionBodyTestGenerated extends AbstractIntentionTest { - public void testAllFilesPresentInConvertToExpressionBody() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/convertToExpressionBody"), Pattern.compile("^before(\\w+)\\.kt$"), true); - } - - @TestMetadata("beforeAnonymousObjectExpression.kt") - public void testAnonymousObjectExpression() throws Exception { - doTest("idea/testData/intentions/convertToExpressionBody/beforeAnonymousObjectExpression.kt"); - } - - @TestMetadata("beforeAssignment.kt") - public void testAssignment() throws Exception { - doTest("idea/testData/intentions/convertToExpressionBody/beforeAssignment.kt"); - } - - @TestMetadata("beforeDeclaration.kt") - public void testDeclaration() throws Exception { - doTest("idea/testData/intentions/convertToExpressionBody/beforeDeclaration.kt"); - } - - @TestMetadata("beforeExpressionWithReturns1.kt") - public void testExpressionWithReturns1() throws Exception { - doTest("idea/testData/intentions/convertToExpressionBody/beforeExpressionWithReturns1.kt"); - } - - @TestMetadata("beforeExpressionWithReturns2.kt") - public void testExpressionWithReturns2() throws Exception { - doTest("idea/testData/intentions/convertToExpressionBody/beforeExpressionWithReturns2.kt"); - } - - @TestMetadata("beforeFunWithImplicitUnitTypeWithThrow.kt") - public void testFunWithImplicitUnitTypeWithThrow() throws Exception { - doTest("idea/testData/intentions/convertToExpressionBody/beforeFunWithImplicitUnitTypeWithThrow.kt"); - } - - @TestMetadata("beforeFunWithNoBlock.kt") - public void testFunWithNoBlock() throws Exception { - doTest("idea/testData/intentions/convertToExpressionBody/beforeFunWithNoBlock.kt"); - } - - @TestMetadata("beforeFunWithNothingType.kt") - public void testFunWithNothingType() throws Exception { - doTest("idea/testData/intentions/convertToExpressionBody/beforeFunWithNothingType.kt"); - } - - @TestMetadata("beforeFunWithReturn.kt") - public void testFunWithReturn() throws Exception { - doTest("idea/testData/intentions/convertToExpressionBody/beforeFunWithReturn.kt"); - } - - @TestMetadata("beforeFunWithUnitType.kt") - public void testFunWithUnitType() throws Exception { - doTest("idea/testData/intentions/convertToExpressionBody/beforeFunWithUnitType.kt"); - } - - @TestMetadata("beforeFunWithUnitType2.kt") - public void testFunWithUnitType2() throws Exception { - doTest("idea/testData/intentions/convertToExpressionBody/beforeFunWithUnitType2.kt"); - } - - @TestMetadata("beforeFunWithUnitTypeWithThrow.kt") - public void testFunWithUnitTypeWithThrow() throws Exception { - doTest("idea/testData/intentions/convertToExpressionBody/beforeFunWithUnitTypeWithThrow.kt"); - } - - @TestMetadata("beforeFunctionLiteral.kt") - public void testFunctionLiteral() throws Exception { - doTest("idea/testData/intentions/convertToExpressionBody/beforeFunctionLiteral.kt"); - } - - @TestMetadata("beforeGetWithReturn.kt") - public void testGetWithReturn() throws Exception { - doTest("idea/testData/intentions/convertToExpressionBody/beforeGetWithReturn.kt"); - } - - @TestMetadata("beforeMultipleStatements.kt") - public void testMultipleStatements() throws Exception { - doTest("idea/testData/intentions/convertToExpressionBody/beforeMultipleStatements.kt"); - } - - @TestMetadata("beforeReturnWithNoValue.kt") - public void testReturnWithNoValue() throws Exception { - doTest("idea/testData/intentions/convertToExpressionBody/beforeReturnWithNoValue.kt"); - } - - @TestMetadata("beforeWhile.kt") - public void testWhile() throws Exception { - doTest("idea/testData/intentions/convertToExpressionBody/beforeWhile.kt"); - } - -} diff --git a/idea/tests/org/jetbrains/jet/plugin/intentions/SpecifyTypeExplicitlyTest.java b/idea/tests/org/jetbrains/jet/plugin/intentions/SpecifyTypeExplicitlyTest.java deleted file mode 100644 index e0b277f4a6b..00000000000 --- a/idea/tests/org/jetbrains/jet/plugin/intentions/SpecifyTypeExplicitlyTest.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2010-2013 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.jet.plugin.intentions; - -import com.intellij.openapi.projectRoots.Sdk; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.plugin.PluginTestCaseBase; -import org.jetbrains.jet.plugin.quickfix.AbstractQuickFixTest; - -public class SpecifyTypeExplicitlyTest extends AbstractQuickFixTest { - public void testBadCaretPosition() { - doTest(); - } - - public void testClassNameClashing() { - doTest(); - } - - public void testFunctionType() { - doTest(); - } - - public void testStringRedefined() { - doTest(); - } - - public void testTypeAlreadyProvided() { - doTest(); - } - - public void testUnitType() { - doTest(); - } - - public void testUnknownType() { - doTest(); - } - - public void testLoopParameter() { - doTest(); - } - - public void testOnType() { - doTest(); - } - - public void testEnumType() { - doTest(); - } - - public void testRemoveUnresolvedType() { - doTest(); - } - - public void testPublicMember() { - doTest(); - } - - @NotNull - @Override - protected String getTestDataPath() { - return PluginTestCaseBase.getTestDataPathBase() + "/intentions/"; - } - - @Override - protected Sdk getProjectJDK() { - return PluginTestCaseBase.jdkFromIdeaHome(); - } - - @Override - protected String getBasePath() { - return "specifyType"; - } - - private void doTest() { - doSingleTest(getTestName(false) + ".kt"); - } -}