diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.172 b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.172 new file mode 100644 index 00000000000..f94a2483236 --- /dev/null +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.172 @@ -0,0 +1,1128 @@ +/* + * Copyright 2010-2017 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.kotlin.generators.tests + +import org.jetbrains.kotlin.AbstractDataFlowValueRenderingTest +import org.jetbrains.kotlin.addImport.AbstractAddImportTest +import org.jetbrains.kotlin.allopen.AbstractBytecodeListingTestForAllOpen +import org.jetbrains.kotlin.android.* +import org.jetbrains.kotlin.android.annotator.AbstractAndroidGutterIconTest +import org.jetbrains.kotlin.android.configure.AbstractConfigureProjectTest +import org.jetbrains.kotlin.android.folding.AbstractAndroidResourceFoldingTest +import org.jetbrains.kotlin.android.intention.AbstractAndroidIntentionTest +import org.jetbrains.kotlin.android.intention.AbstractAndroidResourceIntentionTest +import org.jetbrains.kotlin.android.lint.AbstractKotlinLintTest +import org.jetbrains.kotlin.android.parcel.AbstractParcelBytecodeListingTest +import org.jetbrains.kotlin.android.quickfix.AbstractAndroidLintQuickfixTest +import org.jetbrains.kotlin.android.quickfix.AbstractAndroidQuickFixMultiFileTest +import org.jetbrains.kotlin.android.synthetic.test.AbstractAndroidBoxTest +import org.jetbrains.kotlin.android.synthetic.test.AbstractAndroidBytecodeShapeTest +import org.jetbrains.kotlin.android.synthetic.test.AbstractAndroidSyntheticPropertyDescriptorTest +import org.jetbrains.kotlin.annotation.AbstractAnnotationProcessorBoxTest +import org.jetbrains.kotlin.checkers.AbstractJavaAgainstKotlinBinariesCheckerTest +import org.jetbrains.kotlin.checkers.AbstractJavaAgainstKotlinSourceCheckerTest +import org.jetbrains.kotlin.checkers.AbstractJsCheckerTest +import org.jetbrains.kotlin.checkers.AbstractPsiCheckerTest +import org.jetbrains.kotlin.findUsages.AbstractFindUsagesTest +import org.jetbrains.kotlin.findUsages.AbstractKotlinFindUsagesWithLibraryTest +import org.jetbrains.kotlin.formatter.AbstractFormatterTest +import org.jetbrains.kotlin.formatter.AbstractTypingIndentationTestBase +import org.jetbrains.kotlin.generators.tests.generator.TestGroup +import org.jetbrains.kotlin.generators.tests.generator.testGroup +import org.jetbrains.kotlin.generators.util.KT_OR_KTS +import org.jetbrains.kotlin.generators.util.KT_OR_KTS_WITHOUT_DOTS_IN_NAME +import org.jetbrains.kotlin.generators.util.KT_WITHOUT_DOTS_IN_NAME +import org.jetbrains.kotlin.idea.AbstractExpressionSelectionTest +import org.jetbrains.kotlin.idea.AbstractKotlinTypeAliasByExpansionShortNameIndexTest +import org.jetbrains.kotlin.idea.AbstractSmartSelectionTest +import org.jetbrains.kotlin.idea.actions.AbstractGotoTestOrCodeActionTest +import org.jetbrains.kotlin.idea.caches.resolve.AbstractIdeCompiledLightClassTest +import org.jetbrains.kotlin.idea.caches.resolve.AbstractIdeLightClassTest +import org.jetbrains.kotlin.idea.caches.resolve.AbstractMultiModuleLineMarkerTest +import org.jetbrains.kotlin.idea.codeInsight.* +import org.jetbrains.kotlin.idea.codeInsight.generate.AbstractCodeInsightActionTest +import org.jetbrains.kotlin.idea.codeInsight.generate.AbstractGenerateHashCodeAndEqualsActionTest +import org.jetbrains.kotlin.idea.codeInsight.generate.AbstractGenerateTestSupportMethodActionTest +import org.jetbrains.kotlin.idea.codeInsight.generate.AbstractGenerateToStringActionTest +import org.jetbrains.kotlin.idea.codeInsight.moveUpDown.AbstractMoveLeftRightTest +import org.jetbrains.kotlin.idea.codeInsight.moveUpDown.AbstractMoveStatementTest +import org.jetbrains.kotlin.idea.codeInsight.postfix.AbstractPostfixTemplateProviderTest +import org.jetbrains.kotlin.idea.codeInsight.surroundWith.AbstractSurroundWithTest +import org.jetbrains.kotlin.idea.codeInsight.unwrap.AbstractUnwrapRemoveTest +import org.jetbrains.kotlin.idea.completion.test.* +import org.jetbrains.kotlin.idea.completion.test.handlers.AbstractBasicCompletionHandlerTest +import org.jetbrains.kotlin.idea.completion.test.handlers.AbstractCompletionCharFilterTest +import org.jetbrains.kotlin.idea.completion.test.handlers.AbstractKeywordCompletionHandlerTest +import org.jetbrains.kotlin.idea.completion.test.handlers.AbstractSmartCompletionHandlerTest +import org.jetbrains.kotlin.idea.completion.test.weighers.AbstractBasicCompletionWeigherTest +import org.jetbrains.kotlin.idea.completion.test.weighers.AbstractSmartCompletionWeigherTest +import org.jetbrains.kotlin.idea.configuration.AbstractGradleConfigureProjectByChangingFileTest +import org.jetbrains.kotlin.idea.conversion.copy.AbstractJavaToKotlinCopyPasteConversionTest +import org.jetbrains.kotlin.idea.conversion.copy.AbstractLiteralKotlinToKotlinCopyPasteTest +import org.jetbrains.kotlin.idea.conversion.copy.AbstractLiteralTextToKotlinCopyPasteTest +import org.jetbrains.kotlin.idea.conversion.copy.AbstractTextJavaToKotlinCopyPasteConversionTest +import org.jetbrains.kotlin.idea.coverage.AbstractKotlinCoverageOutputFilesTest +import org.jetbrains.kotlin.idea.debugger.AbstractBeforeExtractFunctionInsertionTest +import org.jetbrains.kotlin.idea.debugger.AbstractKotlinSteppingTest +import org.jetbrains.kotlin.idea.debugger.AbstractPositionManagerTest +import org.jetbrains.kotlin.idea.debugger.AbstractSmartStepIntoTest +import org.jetbrains.kotlin.idea.debugger.evaluate.* +import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToDecompiledLibraryTest +import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTest +import org.jetbrains.kotlin.idea.decompiler.stubBuilder.AbstractClsStubBuilderTest +import org.jetbrains.kotlin.idea.decompiler.stubBuilder.AbstractLoadJavaClsStubTest +import org.jetbrains.kotlin.idea.decompiler.textBuilder.AbstractCommonDecompiledTextFromJsMetadataTest +import org.jetbrains.kotlin.idea.decompiler.textBuilder.AbstractCommonDecompiledTextTest +import org.jetbrains.kotlin.idea.decompiler.textBuilder.AbstractJsDecompiledTextFromJsMetadataTest +import org.jetbrains.kotlin.idea.decompiler.textBuilder.AbstractJvmDecompiledTextTest +import org.jetbrains.kotlin.idea.editor.AbstractMultiLineStringIndentTest +import org.jetbrains.kotlin.idea.editor.backspaceHandler.AbstractBackspaceHandlerTest +import org.jetbrains.kotlin.idea.editor.quickDoc.AbstractQuickDocProviderTest +import org.jetbrains.kotlin.idea.filters.AbstractKotlinExceptionFilterTest +import org.jetbrains.kotlin.idea.folding.AbstractKotlinFoldingTest +import org.jetbrains.kotlin.idea.hierarchy.AbstractHierarchyTest +import org.jetbrains.kotlin.idea.hierarchy.AbstractHierarchyWithLibTest +import org.jetbrains.kotlin.idea.highlighter.* +import org.jetbrains.kotlin.idea.imports.AbstractJsOptimizeImportsTest +import org.jetbrains.kotlin.idea.imports.AbstractJvmOptimizeImportsTest +import org.jetbrains.kotlin.idea.inspections.AbstractLocalInspectionTest +import org.jetbrains.kotlin.idea.inspections.AbstractMultiFileLocalInspectionTest +import org.jetbrains.kotlin.idea.intentions.AbstractConcatenatedStringGeneratorTest +import org.jetbrains.kotlin.idea.intentions.AbstractIntentionTest +import org.jetbrains.kotlin.idea.intentions.AbstractIntentionTest2 +import org.jetbrains.kotlin.idea.intentions.AbstractMultiFileIntentionTest +import org.jetbrains.kotlin.idea.intentions.declarations.AbstractJoinLinesTest +import org.jetbrains.kotlin.idea.internal.AbstractBytecodeToolWindowTest +import org.jetbrains.kotlin.idea.kdoc.AbstractKDocHighlightingTest +import org.jetbrains.kotlin.idea.kdoc.AbstractKDocTypingTest +import org.jetbrains.kotlin.idea.maven.AbstractKotlinMavenInspectionTest +import org.jetbrains.kotlin.idea.maven.configuration.AbstractMavenConfigureProjectByChangingFileTest +import org.jetbrains.kotlin.idea.navigation.* +import org.jetbrains.kotlin.idea.parameterInfo.AbstractParameterInfoTest +import org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixMultiFileTest +import org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixMultiModuleTest +import org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest +import org.jetbrains.kotlin.idea.refactoring.AbstractNameSuggestionProviderTest +import org.jetbrains.kotlin.idea.refactoring.copy.AbstractCopyTest +import org.jetbrains.kotlin.idea.refactoring.copy.AbstractMultiModuleCopyTest +import org.jetbrains.kotlin.idea.refactoring.inline.AbstractInlineTest +import org.jetbrains.kotlin.idea.refactoring.introduce.AbstractExtractionTest +import org.jetbrains.kotlin.idea.refactoring.move.AbstractMoveTest +import org.jetbrains.kotlin.idea.refactoring.move.AbstractMultiModuleMoveTest +import org.jetbrains.kotlin.idea.refactoring.pullUp.AbstractPullUpTest +import org.jetbrains.kotlin.idea.refactoring.pushDown.AbstractPushDownTest +import org.jetbrains.kotlin.idea.refactoring.rename.AbstractMultiModuleRenameTest +import org.jetbrains.kotlin.idea.refactoring.rename.AbstractRenameTest +import org.jetbrains.kotlin.idea.refactoring.safeDelete.AbstractMultiModuleSafeDeleteTest +import org.jetbrains.kotlin.idea.refactoring.safeDelete.AbstractSafeDeleteTest +import org.jetbrains.kotlin.idea.repl.AbstractIdeReplCompletionTest +import org.jetbrains.kotlin.idea.resolve.* +import org.jetbrains.kotlin.idea.scratch.AbstractScratchRunActionTest +import org.jetbrains.kotlin.idea.script.AbstractScriptConfigurationCompletionTest +import org.jetbrains.kotlin.idea.script.AbstractScriptConfigurationHighlightingTest +import org.jetbrains.kotlin.idea.script.AbstractScriptConfigurationNavigationTest +import org.jetbrains.kotlin.idea.slicer.AbstractSlicerLeafGroupingTest +import org.jetbrains.kotlin.idea.slicer.AbstractSlicerTreeTest +import org.jetbrains.kotlin.idea.structureView.AbstractKotlinFileStructureTest +import org.jetbrains.kotlin.idea.stubs.AbstractMultiFileHighlightingTest +import org.jetbrains.kotlin.idea.stubs.AbstractResolveByStubTest +import org.jetbrains.kotlin.idea.stubs.AbstractStubBuilderTest +import org.jetbrains.kotlin.incremental.* +import org.jetbrains.kotlin.j2k.AbstractJavaToKotlinConverterForWebDemoTest +import org.jetbrains.kotlin.j2k.AbstractJavaToKotlinConverterMultiFileTest +import org.jetbrains.kotlin.j2k.AbstractJavaToKotlinConverterSingleFileTest +import org.jetbrains.kotlin.jps.build.* +import org.jetbrains.kotlin.jps.build.android.AbstractAndroidJpsTestCase +import org.jetbrains.kotlin.jps.incremental.AbstractJsProtoComparisonTest +import org.jetbrains.kotlin.jps.incremental.AbstractJvmProtoComparisonTest +import org.jetbrains.kotlin.kapt3.test.AbstractClassFileToSourceStubConverterTest +import org.jetbrains.kotlin.kapt3.test.AbstractKotlinKaptContextTest +import org.jetbrains.kotlin.noarg.AbstractBlackBoxCodegenTestForNoArg +import org.jetbrains.kotlin.noarg.AbstractBytecodeListingTestForNoArg +import org.jetbrains.kotlin.psi.patternMatching.AbstractPsiUnifierTest +import org.jetbrains.kotlin.samWithReceiver.AbstractSamWithReceiverScriptTest +import org.jetbrains.kotlin.samWithReceiver.AbstractSamWithReceiverTest +import org.jetbrains.kotlin.search.AbstractAnnotatedMembersSearchTest +import org.jetbrains.kotlin.search.AbstractInheritorsSearchTest +import org.jetbrains.kotlin.shortenRefs.AbstractShortenRefsTest +import org.jetbrains.kotlin.test.TargetBackend + +fun main(args: Array) { + System.setProperty("java.awt.headless", "true") + + testGroup("idea/tests", "idea/testData") { + testClass { + model("resolve/additionalLazyResolve") + } + + testClass { + model("resolve/partialBodyResolve") + } + + testClass { + model("checker", recursive = false) + model("checker/regression") + model("checker/recovery") + model("checker/rendering") + model("checker/scripts", extension = "kts") + model("checker/duplicateJvmSignature") + model("checker/infos", testMethod = "doTestWithInfos") + model("checker/diagnosticsMessage") + } + + testClass { + model("kotlinAndJavaChecker/javaAgainstKotlin") + model("kotlinAndJavaChecker/javaWithKotlin") + } + + testClass { + model("kotlinAndJavaChecker/javaAgainstKotlin") + } + + testClass { + model("unifier") + } + + testClass { + model("checker/codeFragments", extension = "kt", recursive = false) + model("checker/codeFragments/imports", testMethod = "doTestWithImport", extension = "kt") + } + + testClass { + model("quickfix.special/codeFragmentAutoImport", extension = "kt", recursive = false) + } + + testClass { + model("checker/js") + } + + testClass { + model("quickfix", pattern = "^([\\w\\-_]+)\\.kt$", filenameStartsLowerCase = true) + } + + testClass { + model("navigation/gotoSuper", extension = "test", recursive = false) + } + + testClass { + model("navigation/gotoTypeDeclaration", extension = "test") + } + + testClass { + model("navigation/gotoDeclaration", extension = "test") + } + + testClass { + model("parameterInfo", recursive = true, excludeDirs = listOf("withLib1/sharedLib", "withLib2/sharedLib", "withLib3/sharedLib")) + } + + testClass { + model("navigation/gotoClass", testMethod = "doClassTest") + model("navigation/gotoSymbol", testMethod = "doSymbolTest") + } + + testClass { + model("decompiler/navigation/usercode") + model("decompiler/navigation/usercode", testClassName ="UsercodeWithJSModule", testMethod = "doWithJSModuleTest") + } + + testClass { + model("decompiler/navigation/usercode") + } + + testClass { + model("navigation/implementations", recursive = false) + } + + testClass { + model("navigation/gotoTestOrCode", pattern = "^(.+)\\.main\\..+\$") + } + + testClass { + model("search/inheritance") + } + + testClass { + model("search/annotations") + } + + testClass { + model("quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") + } + + testClass { + model("typealiasExpansionIndex") + } + + testClass { + model("highlighter") + } + + testClass { + model("dslHighlighter") + } + + testClass { + model("usageHighlighter") + } + + testClass { + model("folding/noCollapse") + model("folding/checkCollapse", testMethod = "doSettingsFoldingTest") + } + + testClass { + model("codeInsight/surroundWith/if", testMethod = "doTestWithIfSurrounder") + model("codeInsight/surroundWith/ifElse", testMethod = "doTestWithIfElseSurrounder") + model("codeInsight/surroundWith/ifElseExpression", testMethod = "doTestWithIfElseExpressionSurrounder") + model("codeInsight/surroundWith/ifElseExpressionBraces", testMethod = "doTestWithIfElseExpressionBracesSurrounder") + model("codeInsight/surroundWith/not", testMethod = "doTestWithNotSurrounder") + model("codeInsight/surroundWith/parentheses", testMethod = "doTestWithParenthesesSurrounder") + model("codeInsight/surroundWith/stringTemplate", testMethod = "doTestWithStringTemplateSurrounder") + model("codeInsight/surroundWith/when", testMethod = "doTestWithWhenSurrounder") + model("codeInsight/surroundWith/tryCatch", testMethod = "doTestWithTryCatchSurrounder") + model("codeInsight/surroundWith/tryCatchExpression", testMethod = "doTestWithTryCatchExpressionSurrounder") + model("codeInsight/surroundWith/tryCatchFinally", testMethod = "doTestWithTryCatchFinallySurrounder") + model("codeInsight/surroundWith/tryCatchFinallyExpression", testMethod = "doTestWithTryCatchFinallyExpressionSurrounder") + model("codeInsight/surroundWith/tryFinally", testMethod = "doTestWithTryFinallySurrounder") + model("codeInsight/surroundWith/functionLiteral", testMethod = "doTestWithFunctionLiteralSurrounder") + model("codeInsight/surroundWith/withIfExpression", testMethod = "doTestWithSurroundWithIfExpression") + model("codeInsight/surroundWith/withIfElseExpression", testMethod = "doTestWithSurroundWithIfElseExpression") + } + + testClass { + model("joinLines") + } + + testClass { + model("codeInsight/breadcrumbs") + } + + testClass { + model("intentions", pattern = "^([\\w\\-_]+)\\.(kt|kts)$") + } + + testClass { + model("intentions/loopToCallChain", pattern = "^([\\w\\-_]+)\\.kt$") + } + + testClass { + model("concatenatedStringGenerator", pattern = "^([\\w\\-_]+)\\.kt$") + } + + testClass { + model("intentions", pattern = "^(inspections\\.test)$", singleClass = true) + model("inspections", pattern = "^(inspections\\.test)$", singleClass = true) + model("inspectionsLocal", pattern = "^(inspections\\.test)$", singleClass = true) + } + + testClass { + model("inspectionsLocal", pattern = "^([\\w\\-_]+)\\.(kt|kts)$") + } + + testClass { + model("hierarchy/class/type", extension = null, recursive = false, testMethod = "doTypeClassHierarchyTest") + model("hierarchy/class/super", extension = null, recursive = false, testMethod = "doSuperClassHierarchyTest") + model("hierarchy/class/sub", extension = null, recursive = false, testMethod = "doSubClassHierarchyTest") + model("hierarchy/calls/callers", extension = null, recursive = false, testMethod = "doCallerHierarchyTest") + model("hierarchy/calls/callersJava", extension = null, recursive = false, testMethod = "doCallerJavaHierarchyTest") + model("hierarchy/calls/callees", extension = null, recursive = false, testMethod = "doCalleeHierarchyTest") + model("hierarchy/overrides", extension = null, recursive = false, testMethod = "doOverrideHierarchyTest") + } + + testClass { + model("hierarchy/withLib", extension = null, recursive = false) + } + + testClass { + model("codeInsight/moveUpDown/classBodyDeclarations", pattern = KT_OR_KTS, testMethod = "doTestClassBodyDeclaration") + model("codeInsight/moveUpDown/closingBraces", testMethod = "doTestExpression") + model("codeInsight/moveUpDown/expressions", pattern = KT_OR_KTS, testMethod = "doTestExpression") + model("codeInsight/moveUpDown/parametersAndArguments", testMethod = "doTestExpression") + } + + testClass { + model("codeInsight/moveLeftRight") + } + + testClass { + model("refactoring/inline", pattern = "^(\\w+)\\.kt$") + } + + testClass { + model("codeInsight/unwrapAndRemove/removeExpression", testMethod = "doTestExpressionRemover") + model("codeInsight/unwrapAndRemove/unwrapThen", testMethod = "doTestThenUnwrapper") + model("codeInsight/unwrapAndRemove/unwrapElse", testMethod = "doTestElseUnwrapper") + model("codeInsight/unwrapAndRemove/removeElse", testMethod = "doTestElseRemover") + model("codeInsight/unwrapAndRemove/unwrapLoop", testMethod = "doTestLoopUnwrapper") + model("codeInsight/unwrapAndRemove/unwrapTry", testMethod = "doTestTryUnwrapper") + model("codeInsight/unwrapAndRemove/unwrapCatch", testMethod = "doTestCatchUnwrapper") + model("codeInsight/unwrapAndRemove/removeCatch", testMethod = "doTestCatchRemover") + model("codeInsight/unwrapAndRemove/unwrapFinally", testMethod = "doTestFinallyUnwrapper") + model("codeInsight/unwrapAndRemove/removeFinally", testMethod = "doTestFinallyRemover") + model("codeInsight/unwrapAndRemove/unwrapLambda", testMethod = "doTestLambdaUnwrapper") + model("codeInsight/unwrapAndRemove/unwrapFunctionParameter", testMethod = "doTestFunctionParameterUnwrapper") + } + + testClass { + model("codeInsight/expressionType") + } + + testClass { + model("editor/backspaceHandler") + } + + testClass { + model("editor/enterHandler/multilineString") + } + + testClass { + model("editor/quickDoc", pattern = """^([^_]+)\.[^\.]*$""") + } + + testClass { + model("refactoring/safeDelete/deleteClass/kotlinClass", testMethod = "doClassTest") + model("refactoring/safeDelete/deleteClass/kotlinClassWithJava", testMethod = "doClassTestWithJava") + model("refactoring/safeDelete/deleteClass/javaClassWithKotlin", extension = "java", testMethod = "doJavaClassTest") + model("refactoring/safeDelete/deleteObject/kotlinObject", testMethod = "doObjectTest") + model("refactoring/safeDelete/deleteFunction/kotlinFunction", testMethod = "doFunctionTest") + model("refactoring/safeDelete/deleteFunction/kotlinFunctionWithJava", testMethod = "doFunctionTestWithJava") + model("refactoring/safeDelete/deleteFunction/javaFunctionWithKotlin", testMethod = "doJavaMethodTest") + model("refactoring/safeDelete/deleteProperty/kotlinProperty", testMethod = "doPropertyTest") + model("refactoring/safeDelete/deleteProperty/kotlinPropertyWithJava", testMethod = "doPropertyTestWithJava") + model("refactoring/safeDelete/deleteProperty/javaPropertyWithKotlin", testMethod = "doJavaPropertyTest") + model("refactoring/safeDelete/deleteTypeAlias/kotlinTypeAlias", testMethod = "doTypeAliasTest") + model("refactoring/safeDelete/deleteTypeParameter/kotlinTypeParameter", testMethod = "doTypeParameterTest") + model("refactoring/safeDelete/deleteTypeParameter/kotlinTypeParameterWithJava", testMethod = "doTypeParameterTestWithJava") + model("refactoring/safeDelete/deleteValueParameter/kotlinValueParameter", testMethod = "doValueParameterTest") + model("refactoring/safeDelete/deleteValueParameter/kotlinValueParameterWithJava", testMethod = "doValueParameterTestWithJava") + } + + testClass { + model("resolve/references", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("resolve/referenceInJava/binaryAndSource", extension = "java") + model("resolve/referenceInJava/sourceOnly", extension = "java") + } + + testClass { + model("resolve/referenceInJava/binaryAndSource", extension = "java") + } + + testClass { + model("resolve/referenceWithLib", recursive = false) + } + + testClass { + model("resolve/referenceInLib", recursive = false) + } + + testClass { + model("resolve/referenceToJavaWithWrongFileStructure", recursive = false) + } + + testClass { + model("findUsages/kotlin", pattern = """^(.+)\.0\.(kt|kts)$""") + model("findUsages/java", pattern = """^(.+)\.0\.java$""") + model("findUsages/propertyFiles", pattern = """^(.+)\.0\.properties$""") + } + + testClass { + model("findUsages/libraryUsages", pattern = """^(.+)\.0\.kt$""") + } + + testClass { + model("refactoring/move", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/copy", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/moveMultiModule", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/copyMultiModule", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/safeDeleteMultiModule", extension = "test", singleClass = true) + } + + testClass { + model("multiFileIntentions", extension = "test", singleClass = true, filenameStartsLowerCase = true) + } + + testClass { + model("multiFileLocalInspections", extension = "test", singleClass = true, filenameStartsLowerCase = true) + } + + testClass { + model("multiFileInspections", extension = "test", singleClass = true) + } + + testClass { + model("formatter", pattern = """^([^\.]+)\.after\.kt.*$""") + model("formatter", pattern = """^([^\.]+)\.after\.inv\.kt.*$""", + testMethod = "doTestInverted", testClassName = "FormatterInverted") + } + + testClass { + model("indentationOnNewline", pattern = """^([^\.]+)\.after\.kt.*$""", testMethod = "doNewlineTest", + testClassName = "DirectSettings") + model("indentationOnNewline", pattern = """^([^\.]+)\.after\.inv\.kt.*$""", testMethod = "doNewlineTestWithInvert", + testClassName = "InvertedSettings") + } + + testClass { + model("diagnosticMessage", recursive = false) + } + + testClass { + model("diagnosticMessage/js", recursive = false, targetBackend = TargetBackend.JS) + } + + testClass { + model("refactoring/rename", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/renameMultiModule", extension = "test", singleClass = true) + } + + testClass { + model("codeInsight/outOfBlock") + } + + testClass { + model("dataFlowValueRendering") + } + + testClass { + model("copyPaste/conversion", pattern = """^([^\.]+)\.java$""") + } + + testClass { + model("copyPaste/plainTextConversion", pattern = """^([^\.]+)\.txt$""") + } + + testClass { + model("copyPaste/plainTextLiteral", pattern = """^([^\.]+)\.txt$""") + } + + testClass { + model("copyPaste/literal", pattern = """^([^\.]+)\.kt$""") + } + + testClass { + model("copyPaste/imports", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTestCopy", testClassName = "Copy", recursive = false) + model("copyPaste/imports", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTestCut", testClassName = "Cut", recursive = false) + } + + testClass { + model("copyPaste/moveDeclarations", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTest") + } + + testClass { + model("exitPoints") + } + + testClass { + model("codeInsight/lineMarker") + } + + testClass { + model("multiModuleLineMarker", extension = null, recursive = false) + } + + testClass { + model("shortenRefs", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + testClass { + model("addImport", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("smartSelection", testMethod = "doTestSmartSelection", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("structureView/fileStructure", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("expressionSelection", testMethod = "doTestExpressionSelection", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("decompiler/decompiledText", pattern = """^([^\.]+)$""") + } + + testClass { + model("decompiler/decompiledTextJvm", pattern = """^([^\.]+)$""") + } + + testClass { + model("decompiler/decompiledText", pattern = """^([^\.]+)$""", targetBackend = TargetBackend.JS) + } + + testClass { + model("decompiler/decompiledTextJs", pattern = """^([^\.]+)$""", targetBackend = TargetBackend.JS) + } + + testClass { + model("decompiler/stubBuilder", extension = null, recursive = false) + } + + testClass { + model("editor/optimizeImports/jvm", pattern = KT_WITHOUT_DOTS_IN_NAME) + model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + testClass { + model("editor/optimizeImports/js", pattern = KT_WITHOUT_DOTS_IN_NAME) + model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("debugger/positionManager", recursive = false, extension = "kt", testClassName = "SingleFile") + model("debugger/positionManager", recursive = false, extension = null, testClassName = "MultiFile") + } + + testClass { + model("debugger/exceptionFilter", pattern = """^([^\.]+)$""", recursive = false) + } + + testClass { + model("debugger/smartStepInto") + } + + testClass { + model("debugger/insertBeforeExtractFunction", extension = "kt") + } + + testClass { + model("debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest", testClassName = "StepInto") + model("debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doSmartStepIntoTest", testClassName = "SmartStepInto") + model("debugger/tinyApp/src/stepping/stepInto", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest", testClassName = "StepIntoOnly") + model("debugger/tinyApp/src/stepping/stepOut", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOutTest") + model("debugger/tinyApp/src/stepping/stepOver", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverTest") + model("debugger/tinyApp/src/stepping/stepOverForce", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverForceTest") + model("debugger/tinyApp/src/stepping/filters", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest") + model("debugger/tinyApp/src/stepping/custom", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doCustomTest") + } + + testClass { + model("debugger/tinyApp/src/evaluate/singleBreakpoint", testMethod = "doSingleBreakpointTest") + model("debugger/tinyApp/src/evaluate/multipleBreakpoints", testMethod = "doMultipleBreakpointsTest") + } + + testClass { + model("stubs", extension = "kt") + } + + testClass { + model("multiFileHighlighting", recursive = false) + } + + testClass { + model("multiModuleQuickFix", recursive = false, extension = null) + } + + testClass { + model("navigation/implementations/multiModule", recursive = false, extension = null) + } + + testClass { + model("navigation/relatedSymbols/multiModule", recursive = false, extension = null) + } + + testClass { + model("navigation/gotoSuper/multiModule", recursive = false, extension = null) + } + + testClass { + model("refactoring/introduceVariable", pattern = KT_OR_KTS, testMethod = "doIntroduceVariableTest") + model("refactoring/extractFunction", pattern = KT_OR_KTS, testMethod = "doExtractFunctionTest") + model("refactoring/introduceProperty", pattern = KT_OR_KTS, testMethod = "doIntroducePropertyTest") + model("refactoring/introduceParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceSimpleParameterTest") + model("refactoring/introduceLambdaParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceLambdaParameterTest") + model("refactoring/introduceJavaParameter", extension = "java", testMethod = "doIntroduceJavaParameterTest") + model("refactoring/introduceTypeParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceTypeParameterTest") + model("refactoring/introduceTypeAlias", pattern = KT_OR_KTS, testMethod = "doIntroduceTypeAliasTest") + model("refactoring/extractSuperclass", pattern = KT_OR_KTS, testMethod = "doExtractSuperclassTest") + model("refactoring/extractInterface", pattern = KT_OR_KTS, testMethod = "doExtractInterfaceTest") + } + + testClass { + model("refactoring/pullUp/k2k", extension = "kt", singleClass = true, testClassName = "K2K", testMethod = "doKotlinTest") + model("refactoring/pullUp/k2j", extension = "kt", singleClass = true, testClassName = "K2J", testMethod = "doKotlinTest") + model("refactoring/pullUp/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") + } + + testClass { + model("refactoring/pushDown/k2k", extension = "kt", singleClass = true, testClassName = "K2K", testMethod = "doKotlinTest") + model("refactoring/pushDown/k2j", extension = "kt", singleClass = true, testClassName = "K2J", testMethod = "doKotlinTest") + model("refactoring/pushDown/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") + } + + testClass { + model("debugger/selectExpression", recursive = false) + model("debugger/selectExpression/disallowMethodCalls", testMethod = "doTestWoMethodCalls") + } + + testClass { + model("coverage/outputFiles") + } + + testClass { + model("internal/toolWindow", recursive = false, extension = null) + } + + testClass("org.jetbrains.kotlin.idea.kdoc.KdocResolveTestGenerated") { + model("kdoc/resolve") + } + + testClass { + model("kdoc/highlighting") + } + + testClass { + model("kdoc/typing") + } + + testClass { + model("codeInsight/generate/testFrameworkSupport") + } + + testClass { + model("codeInsight/generate/equalsWithHashCode") + } + + testClass { + model("codeInsight/generate/secondaryConstructors") + } + + testClass { + model("codeInsight/generate/toString") + } + + testClass { + model("repl/completion") + } + + testClass { + model("codeInsight/postfix") + } + + testClass { + model("script/definition/highlighting", extension = null, recursive = false) + } + + testClass { + model("script/definition/navigation", extension = null, recursive = false) + } + + testClass { + model("script/definition/completion", extension = null, recursive = false) + } + + testClass { + model("refactoring/nameSuggestionProvider") + } + + testClass { + model("slicer", singleClass = true) + } + + testClass { + model("slicer/inflow", singleClass = true) + } + + testClass { + model("scratch", extension = "kts", testMethod = "doCompilingTest", testClassName = "Compiling", recursive = false) + model("scratch", extension = "kts", testMethod = "doReplTest", testClassName = "Repl", recursive = false) + model("scratch/multiFile", extension = null, testMethod = "doMultiFileTest", recursive = false) + } + } + + testGroup("idea/idea-maven/test", "idea/idea-maven/testData") { + testClass { + model("configurator/jvm", extension = null, recursive = false, testMethod = "doTestWithMaven") + model("configurator/js", extension = null, recursive = false, testMethod = "doTestWithJSMaven") + } + + testClass { + model("maven-inspections", pattern = "^([\\w\\-]+).xml$", singleClass = true) + } + } + + testGroup("idea/idea-gradle/tests", "idea/testData") { + testClass { + model("configuration/gradle", extension = null, recursive = false, testMethod = "doTestGradle") + model("configuration/gsk", extension = null, recursive = false, testMethod = "doTestGradle") + } + } + + testGroup("idea/tests", "compiler/testData") { + testClass { + model("loadJava/compiledKotlin") + } + + testClass { + model("loadJava/compiledKotlin", testMethod = "doTestCompiledKotlin") + } + + testClass { + model("asJava/lightClasses", excludeDirs = listOf("delegation"), pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("asJava/lightClasses", excludeDirs = listOf("local", "compilationErrors", "ideRegression"), pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + } + } + + testGroup("idea/idea-completion/tests", "idea/idea-completion/testData") { + testClass { + model("injava", extension = "java", recursive = false) + } + + testClass { + model("injava", extension = "java", recursive = false) + } + + testClass { + model("injava/stdlib", extension = "java", recursive = false) + } + + testClass { + model("weighers/basic", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("weighers/smart", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("basic/common") + model("basic/js") + } + + testClass { + model("basic/common") + model("basic/java") + } + + testClass { + model("smart") + } + + testClass { + model("keywords", recursive = false) + } + + testClass { + model("basic/withLib", recursive = false) + } + + testClass { + model("handlers/basic", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("handlers/smart") + } + + testClass { + model("handlers/keywords") + } + + testClass { + model("handlers/charFilter") + } + + testClass { + model("basic/multifile", extension = null, recursive = false) + } + + testClass { + model("smartMultiFile", extension = null, recursive = false) + } + + testClass("KDocCompletionTestGenerated") { + model("kdoc") + } + + testClass { + model("basic/java8") + } + + testClass { + model("incrementalResolve") + } + + testClass { + model("multiPlatform", recursive = false, extension = null) + } + } + + //TODO: move these tests into idea-completion module + testGroup("idea/tests", "idea/idea-completion/testData") { + testClass { + model("handlers/runtimeCast") + } + + testClass { + model("basic/codeFragments", extension = "kt") + } + } + + testGroup("j2k/tests", "j2k/testData") { + testClass { + model("fileOrElement", extension = "java") + } + } + testGroup("j2k/tests", "j2k/testData") { + testClass { + model("multiFile", extension = null, recursive = false) + } + } + testGroup("j2k/tests", "j2k/testData") { + testClass { + model("fileOrElement", extension = "java") + } + } + + testGroup("jps-plugin/jps-tests/test", "jps-plugin/testData") { + testClass { + model("incremental/multiModule", extension = null, excludeParentDirs = true) + model("incremental/pureKotlin", extension = null, recursive = false) + model("incremental/withJava", extension = null, excludeParentDirs = true) + model("incremental/inlineFunCallSite", extension = null, excludeParentDirs = true) + model("incremental/classHierarchyAffected", extension = null, excludeParentDirs = true) + } + + testClass { + model("incremental/lookupTracker/jvm", extension = null, recursive = false) + } + testClass { + model("incremental/lookupTracker/js", extension = null, recursive = false) + } + + testClass { + model("incremental/lazyKotlinCaches", extension = null, excludeParentDirs = true) + model("incremental/changeIncrementalOption", extension = null, excludeParentDirs = true) + } + + testClass { + model("incremental/cacheVersionChanged", extension = null, excludeParentDirs = true) + } + + testClass { + model("incremental/cacheVersionChanged", extension = null, excludeParentDirs = true) + } + } + + testGroup("jps-plugin/jps-tests/test", "jps-plugin/testData") { + fun TestGroup.TestClass.commonProtoComparisonTests() { + model("comparison/classSignatureChange", extension = null, excludeParentDirs = true) + model("comparison/classPrivateOnlyChange", extension = null, excludeParentDirs = true) + model("comparison/classMembersOnlyChanged", extension = null, excludeParentDirs = true) + model("comparison/packageMembers", extension = null, excludeParentDirs = true) + model("comparison/unchanged", extension = null, excludeParentDirs = true) + } + + testClass { + commonProtoComparisonTests() + model("comparison/jvmOnly", extension = null, excludeParentDirs = true) + } + + testClass { + commonProtoComparisonTests() + model("comparison/jsOnly", extension = null, excludeParentDirs = true) + } + } + + testGroup("compiler/incremental-compilation-impl/test", "jps-plugin/testData") { + testClass { + model("incremental/pureKotlin", extension = null, recursive = false) + model("incremental/classHierarchyAffected", extension = null, recursive = false) + model("incremental/inlineFunCallSite", extension = null, excludeParentDirs = true) + model("incremental/withJava", extension = null, excludeParentDirs = true) + model("incremental/incrementalJvmCompilerOnly", extension = null, excludeParentDirs = true) + } + + testClass { + model("incremental/pureKotlin", extension = null, recursive = false) + model("incremental/classHierarchyAffected", extension = null, recursive = false) + model("incremental/js", extension = null, excludeParentDirs = true) + } + + testClass { + model("incremental/js/friendsModuleDisabled", extension = null, recursive = false) + } + + testClass { + model("incremental/multiplatform", extension = null, excludeParentDirs = true) + } + testClass { + model("incremental/multiplatform", extension = null, excludeParentDirs = true) + } + } + + testGroup("plugins/android-extensions/android-extensions-compiler/test", "plugins/android-extensions/android-extensions-compiler/testData") { + testClass { + model("descriptors", recursive = false, extension = null) + } + + testClass { + model("codegen/android", recursive = false, extension = null, testMethod = "doCompileAgainstAndroidSdkTest") + model("codegen/android", recursive = false, extension = null, testMethod = "doFakeInvocationTest", testClassName = "Invoke") + } + + testClass { + model("codegen/bytecodeShape", recursive = false, extension = null) + } + + testClass { + model("parcel/codegen") + } + } + + testGroup("plugins/annotation-collector/test", "plugins/annotation-collector/testData") { + testClass { + model("collectToFile", recursive = false, extension = null) + } + } + + testGroup("plugins/kapt3/kapt3-compiler/test", "plugins/kapt3/kapt3-compiler/testData") { + testClass { + model("converter") + } + + testClass { + model("kotlinRunner") + } + } + + testGroup("plugins/allopen/allopen-cli/test", "plugins/allopen/allopen-cli/testData") { + testClass { + model("bytecodeListing", extension = "kt") + } + } + + testGroup("plugins/noarg/noarg-cli/test", "plugins/noarg/noarg-cli/testData") { + testClass { + model("bytecodeListing", extension = "kt") + } + + testClass { + model("box", targetBackend = TargetBackend.JVM) + } + } + + testGroup("plugins/sam-with-receiver/sam-with-receiver-cli/test", "plugins/sam-with-receiver/sam-with-receiver-cli/testData") { + testClass { + model("diagnostics") + } + testClass { + model("script", extension = "kts") + } + } + + testGroup("plugins/android-extensions/android-extensions-idea/tests", "plugins/android-extensions/android-extensions-idea/testData") { + testClass { + model("android/completion", recursive = false, extension = null) + } + + testClass { + model("android/goto", recursive = false, extension = null) + } + + testClass { + model("android/rename", recursive = false, extension = null) + } + + testClass { + model("android/renameLayout", recursive = false, extension = null) + } + + testClass { + model("android/findUsages", recursive = false, extension = null) + } + + testClass { + model("android/usageHighlighting", recursive = false, extension = null) + } + + testClass { + model("android/extraction", recursive = false, extension = null) + } + + testClass { + model("android/parcel/checker", excludeParentDirs = true) + } + + testClass { + model("android/parcel/quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") + } + } + + testGroup("idea/idea-android/tests", "idea/testData") { + testClass { + model("configuration/android-gradle", pattern = """(\w+)_before\.gradle$""", testMethod = "doTestAndroidGradle") + model("configuration/android-gsk", pattern = """(\w+)_before\.gradle.kts$""", testMethod = "doTestAndroidGradle") + } + + testClass { + model("android/intention", pattern = "^([\\w\\-_]+)\\.kt$") + } + + testClass { + model("android/resourceIntention", extension = "test", singleClass = true) + } + + testClass { + model("android/quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") + } + + testClass { + model("android/lint", excludeParentDirs = true) + } + + testClass { + model("android/lintQuickfix", pattern = "^([\\w\\-_]+)\\.kt$") + } + + testClass { + model("android/folding") + } + + testClass { + model("android/gutterIcon") + } + } + + testGroup("plugins/android-extensions/android-extensions-jps/test", "plugins/android-extensions/android-extensions-jps/testData") { + testClass { + model("android", recursive = false, extension = null) + } + } +} diff --git a/idea/src/org/jetbrains/kotlin/idea/slicer/KotlinSliceProvider.kt.172 b/idea/src/org/jetbrains/kotlin/idea/slicer/KotlinSliceProvider.kt.172 new file mode 100644 index 00000000000..f05184a09da --- /dev/null +++ b/idea/src/org/jetbrains/kotlin/idea/slicer/KotlinSliceProvider.kt.172 @@ -0,0 +1,73 @@ +/* + * Copyright 2010-2017 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.kotlin.idea.slicer + +import com.intellij.ide.util.treeView.AbstractTreeStructure +import com.intellij.openapi.actionSystem.DefaultActionGroup +import com.intellij.psi.PsiElement +import com.intellij.slicer.* +import org.jetbrains.kotlin.idea.references.mainReference +import org.jetbrains.kotlin.psi.* +import org.jetbrains.kotlin.psi.psiUtil.isPlainWithEscapes +import org.jetbrains.kotlin.psi.psiUtil.parentsWithSelf + +class KotlinSliceProvider : SliceLanguageSupportProvider { + override fun createRootUsage(element: PsiElement, params: SliceAnalysisParams) = KotlinSliceUsage(element, params) + + override fun transform(usage: SliceUsage): Collection? { + if (usage is KotlinSliceUsage) return null + return listOf(KotlinSliceUsage(usage.element, usage.parent, 0, false)) + } + + override fun getExpressionAtCaret(atCaret: PsiElement?, dataFlowToThis: Boolean): KtExpression? { + val element = + atCaret?.parentsWithSelf + ?.firstOrNull { + it is KtProperty || + it is KtParameter || + it is KtDeclarationWithBody || + (it is KtClass && !it.hasExplicitPrimaryConstructor()) || + (it is KtExpression && it !is KtDeclaration) + } + ?.let { KtPsiUtil.safeDeparenthesize(it as KtExpression) } ?: return null + if (dataFlowToThis) { + if (element is KtConstantExpression) return null + if (element is KtStringTemplateExpression && element.isPlainWithEscapes()) return null + if (element is KtClassLiteralExpression) return null + if (element is KtCallableReferenceExpression) return null + } + return element + } + + override fun getElementForDescription(element: PsiElement): PsiElement { + return (element as? KtSimpleNameExpression)?.mainReference?.resolve() ?: element + } + + override fun getRenderer() = KotlinSliceUsageCellRenderer + + override fun startAnalyzeLeafValues(structure: AbstractTreeStructure, finalRunnable: Runnable) { + + } + + override fun startAnalyzeNullness(structure: AbstractTreeStructure, finalRunnable: Runnable) { + + } + + override fun registerExtraPanelActions(group: DefaultActionGroup, builder: SliceTreeBuilder) { + + } +} \ No newline at end of file diff --git a/idea/testData/slicer/inflow/anonymousFunBodyExpression.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/anonymousFunBodyExpression.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/anonymousFunReturnExpression.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/anonymousFunReturnExpression.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/cast.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/cast.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/compositeAssignments.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/compositeAssignments.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/defaultGetterFieldInSetter.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/defaultGetterFieldInSetter.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/delegateGetter.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/delegateGetter.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/diamondHierarchyMiddleClassFun.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/diamondHierarchyMiddleClassFun.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/diamondHierarchyMiddleInterfaceFun.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/diamondHierarchyMiddleInterfaceFun.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/diamondHierarchyRootInterfaceFun.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/diamondHierarchyRootInterfaceFun.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/doubleLambdaResult.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/doubleLambdaResult.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/funParamerer.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/funParamerer.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/funParamererWithDefault.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/funParamererWithDefault.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/funResultViaCallableRef.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/funResultViaCallableRef.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/funResultViaCallableRefWithAssignment.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/funResultViaCallableRefWithAssignment.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/funResultViaCallableRefWithDirectCall.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/funResultViaCallableRefWithDirectCall.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/funWithExpressionBody.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/funWithExpressionBody.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/funWithReturnExpressions.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/funWithReturnExpressions.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/getterAndSetterUsingField.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/getterAndSetterUsingField.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/getterExpressionBody.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/getterExpressionBody.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/getterReturnExpression.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/getterReturnExpression.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/ifExpression.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/ifExpression.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/lambdaResult.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/lambdaResult.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/lambdaResultWithAssignments.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/lambdaResultWithAssignments.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/lambdaResultWithDirectCall.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/lambdaResultWithDirectCall.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/lambdaResultWithDirectCallViaAssignment.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/lambdaResultWithDirectCallViaAssignment.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/localVal.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/localVal.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/localVar.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/localVar.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/memberValWithInitializer.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/memberValWithInitializer.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/memberValWithSplitInitializer.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/memberValWithSplitInitializer.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/memberVarWithInitializer.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/memberVarWithInitializer.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/memberVarWithSplitInitializer.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/memberVarWithSplitInitializer.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/noFieldInGetter.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/noFieldInGetter.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/nonLocalReturn.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/nonLocalReturn.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/notNullAssertion.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/notNullAssertion.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/nullsAndNotNulls.kt.172 b/idea/testData/slicer/inflow/nullsAndNotNulls.kt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/nullsAndNotNulls.leafGroups.txt.172 b/idea/testData/slicer/inflow/nullsAndNotNulls.leafGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/nullsAndNotNulls.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/nullsAndNotNulls.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/nullsAndNotNulls.results.txt.172 b/idea/testData/slicer/inflow/nullsAndNotNulls.results.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/overridingFunctionResult.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/overridingFunctionResult.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/overridingParameter.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/overridingParameter.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/overridingPropertyGetterResult.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/overridingPropertyGetterResult.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/overridingPropertyResult.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/overridingPropertyResult.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/primaryConstructorParameter.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/primaryConstructorParameter.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/primaryConstructorParameterWithDefault.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/primaryConstructorParameterWithDefault.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/qualifiedAssignmentsForQualifiedRef.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/qualifiedAssignmentsForQualifiedRef.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/qualifiedAssignmentsForSimpleRef.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/qualifiedAssignmentsForSimpleRef.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/safeCast.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/safeCast.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/secondaryConstructorParameter.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/secondaryConstructorParameter.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/secondaryConstructorParameterWithDefault.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/secondaryConstructorParameterWithDefault.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/settersViaDelegateForQualifiedRef.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/settersViaDelegateForQualifiedRef.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/settersViaDelegateForSimpleRef.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/settersViaDelegateForSimpleRef.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/topLevelVal.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/topLevelVal.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/topLevelVar.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/topLevelVar.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/valParameter.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/valParameter.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/varParameter.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/varParameter.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/testData/slicer/inflow/whenExpression.nullnessGroups.txt.172 b/idea/testData/slicer/inflow/whenExpression.nullnessGroups.txt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/tests/org/jetbrains/kotlin/idea/slicer/AbstractSlicerNullnessGroupingTest.kt.172 b/idea/tests/org/jetbrains/kotlin/idea/slicer/AbstractSlicerNullnessGroupingTest.kt.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/tests/org/jetbrains/kotlin/idea/slicer/AbstractSlicerTest.kt.172 b/idea/tests/org/jetbrains/kotlin/idea/slicer/AbstractSlicerTest.kt.172 new file mode 100644 index 00000000000..65245dad778 --- /dev/null +++ b/idea/tests/org/jetbrains/kotlin/idea/slicer/AbstractSlicerTest.kt.172 @@ -0,0 +1,135 @@ +/* + * Copyright 2010-2017 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.kotlin.idea.slicer + +import com.intellij.analysis.AnalysisScope +import com.intellij.ide.projectView.TreeStructureProvider +import com.intellij.ide.util.treeView.AbstractTreeStructureBase +import com.intellij.openapi.util.io.FileUtil +import com.intellij.slicer.DuplicateMap +import com.intellij.slicer.SliceAnalysisParams +import com.intellij.slicer.SliceNode +import com.intellij.slicer.SliceRootNode +import com.intellij.usages.TextChunk +import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase +import org.jetbrains.kotlin.psi.KtFile +import org.jetbrains.kotlin.psi.psiUtil.startOffset +import org.jetbrains.kotlin.test.InTextDirectivesUtils +import org.jetbrains.kotlin.test.KotlinTestUtils +import java.awt.Font +import java.io.File + +abstract class AbstractSlicerTest : KotlinLightCodeInsightFixtureTestCase() { + protected class SliceTreeStructure(private val rootNode: SliceNode) : AbstractTreeStructureBase(rootNode.project) { + override fun getProviders(): List? = emptyList() + + override fun getRootElement() = rootNode + + override fun commit() { + + } + + override fun hasSomethingToCommit() = false + } + + companion object { + private val SliceNode.sortedChildren : List + get() = children.sortedBy { it.value.element?.startOffset ?: -1 } + + @JvmStatic + protected fun buildTreeRepresentation(rootNode: SliceNode): String { + fun TextChunk.render(): String { + var text = text + if (attributes.fontType == Font.BOLD) { + text = "$text" + } + return text + } + + fun process(node: SliceNode, indent: Int): String { + val usage = node.element!!.value as KotlinSliceUsage + + node.calculateDupNode() + val isDuplicated = node.duplicate != null + + return buildString { + when { + node is SliceRootNode && usage.element is KtFile -> { + node.sortedChildren.forEach { append(process(it, indent)) } + return@buildString + } + else -> { + val chunks = usage.text + append(chunks.first().render() + " ") + append("\t".repeat(indent)) + if (usage is KotlinSliceDereferenceUsage) { + append("DEREFERENCE: ") + } + append("[LAMBDA] ".repeat(usage.lambdaLevel)) + chunks.slice(1..chunks.size - 1).joinTo( + this, + separator = "", + prefix = if (isDuplicated) "DUPLICATE: " else "", + postfix = "\n" + ) { it.render() } + } + } + + if (!isDuplicated) { + node.sortedChildren.forEach { append(process(it, indent + 1)) } + } + }.replace(Regex(""), "") + } + + return process(rootNode, 0) + } + } + + protected abstract fun doTest(path: String, sliceProvider: KotlinSliceProvider, rootNode: SliceRootNode) + + protected fun doTest(path: String) { + val mainFile = File(path) + val rootDir = mainFile.parentFile + + val namePrefix = FileUtil.getNameWithoutExtension(mainFile) + val extraFiles = rootDir.listFiles { _, name -> name.startsWith("$namePrefix.") } + + myFixture.testDataPath = "${KotlinTestUtils.getHomeDirectory()}/${rootDir.path}" + + val fileText = FileUtil.loadFile(mainFile, true) + val flowKind = InTextDirectivesUtils.findStringWithPrefixes(fileText, "// FLOW: ") + val withDereferences = InTextDirectivesUtils.isDirectiveDefined(fileText, "// WITH_DEREFERENCES") + val analysisParams = SliceAnalysisParams().apply { + dataFlowToThis = when (flowKind) { + "IN" -> true + "OUT" -> false + else -> throw AssertionError("Invalid flow kind: $flowKind") + } + showInstanceDereferences = withDereferences + scope = AnalysisScope(project) + } + + extraFiles.forEach { myFixture.configureByFile(it.name) } + val file = myFixture.configureByFile(mainFile.name) as KtFile + val elementAtCaret = file.findElementAt(editor.caretModel.offset) + val sliceProvider = KotlinSliceProvider() + val expression = sliceProvider.getExpressionAtCaret(elementAtCaret, analysisParams.dataFlowToThis)!! + val rootUsage = sliceProvider.createRootUsage(expression, analysisParams) + val rootNode = SliceRootNode(project, DuplicateMap(), rootUsage) + doTest(path, sliceProvider, rootNode) + } +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/slicer/SlicerLeafGroupingTestGenerated.java.172 b/idea/tests/org/jetbrains/kotlin/idea/slicer/SlicerLeafGroupingTestGenerated.java.172 new file mode 100644 index 00000000000..f5d1d3cf3a5 --- /dev/null +++ b/idea/tests/org/jetbrains/kotlin/idea/slicer/SlicerLeafGroupingTestGenerated.java.172 @@ -0,0 +1,369 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.slicer; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; +import org.jetbrains.kotlin.test.KotlinTestUtils; +import org.jetbrains.kotlin.test.TargetBackend; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.runner.RunWith; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("idea/testData/slicer/inflow") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class SlicerLeafGroupingTestGenerated extends AbstractSlicerLeafGroupingTest { + public void testAllFilesPresentInInflow() throws Exception { + KotlinTestUtils.assertAllTestsPresentInSingleGeneratedClass(this.getClass(), new File("idea/testData/slicer/inflow"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY); + } + + @TestMetadata("anonymousFunBodyExpression.kt") + public void testAnonymousFunBodyExpression() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/anonymousFunBodyExpression.kt"); + doTest(fileName); + } + + @TestMetadata("anonymousFunReturnExpression.kt") + public void testAnonymousFunReturnExpression() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/anonymousFunReturnExpression.kt"); + doTest(fileName); + } + + @TestMetadata("cast.kt") + public void testCast() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/cast.kt"); + doTest(fileName); + } + + @TestMetadata("compositeAssignments.kt") + public void testCompositeAssignments() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/compositeAssignments.kt"); + doTest(fileName); + } + + @TestMetadata("defaultGetterFieldInSetter.kt") + public void testDefaultGetterFieldInSetter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/defaultGetterFieldInSetter.kt"); + doTest(fileName); + } + + @TestMetadata("delegateGetter.kt") + public void testDelegateGetter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/delegateGetter.kt"); + doTest(fileName); + } + + @TestMetadata("delegateToJavaGetter.kt") + public void testDelegateToJavaGetter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/delegateToJavaGetter.kt"); + doTest(fileName); + } + + @TestMetadata("diamondHierarchyJKMiddleClassFun.kt") + public void testDiamondHierarchyJKMiddleClassFun() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/diamondHierarchyJKMiddleClassFun.kt"); + doTest(fileName); + } + + @TestMetadata("diamondHierarchyJKMiddleInterfaceFun.kt") + public void testDiamondHierarchyJKMiddleInterfaceFun() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/diamondHierarchyJKMiddleInterfaceFun.kt"); + doTest(fileName); + } + + @TestMetadata("diamondHierarchyJKRootInterfaceFun.kt") + public void testDiamondHierarchyJKRootInterfaceFun() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/diamondHierarchyJKRootInterfaceFun.kt"); + doTest(fileName); + } + + @TestMetadata("diamondHierarchyMiddleClassFun.kt") + public void testDiamondHierarchyMiddleClassFun() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/diamondHierarchyMiddleClassFun.kt"); + doTest(fileName); + } + + @TestMetadata("diamondHierarchyMiddleInterfaceFun.kt") + public void testDiamondHierarchyMiddleInterfaceFun() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/diamondHierarchyMiddleInterfaceFun.kt"); + doTest(fileName); + } + + @TestMetadata("diamondHierarchyRootInterfaceFun.kt") + public void testDiamondHierarchyRootInterfaceFun() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/diamondHierarchyRootInterfaceFun.kt"); + doTest(fileName); + } + + @TestMetadata("doubleLambdaResult.kt") + public void testDoubleLambdaResult() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/doubleLambdaResult.kt"); + doTest(fileName); + } + + @TestMetadata("funParamerer.kt") + public void testFunParamerer() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/funParamerer.kt"); + doTest(fileName); + } + + @TestMetadata("funParamererWithDefault.kt") + public void testFunParamererWithDefault() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/funParamererWithDefault.kt"); + doTest(fileName); + } + + @TestMetadata("funResultViaCallableRef.kt") + public void testFunResultViaCallableRef() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/funResultViaCallableRef.kt"); + doTest(fileName); + } + + @TestMetadata("funResultViaCallableRefWithAssignment.kt") + public void testFunResultViaCallableRefWithAssignment() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/funResultViaCallableRefWithAssignment.kt"); + doTest(fileName); + } + + @TestMetadata("funResultViaCallableRefWithDirectCall.kt") + public void testFunResultViaCallableRefWithDirectCall() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/funResultViaCallableRefWithDirectCall.kt"); + doTest(fileName); + } + + @TestMetadata("funWithExpressionBody.kt") + public void testFunWithExpressionBody() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/funWithExpressionBody.kt"); + doTest(fileName); + } + + @TestMetadata("funWithReturnExpressions.kt") + public void testFunWithReturnExpressions() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/funWithReturnExpressions.kt"); + doTest(fileName); + } + + @TestMetadata("getterAndSetterUsingField.kt") + public void testGetterAndSetterUsingField() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/getterAndSetterUsingField.kt"); + doTest(fileName); + } + + @TestMetadata("getterExpressionBody.kt") + public void testGetterExpressionBody() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/getterExpressionBody.kt"); + doTest(fileName); + } + + @TestMetadata("getterReturnExpression.kt") + public void testGetterReturnExpression() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/getterReturnExpression.kt"); + doTest(fileName); + } + + @TestMetadata("ifExpression.kt") + public void testIfExpression() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/ifExpression.kt"); + doTest(fileName); + } + + @TestMetadata("lambdaResult.kt") + public void testLambdaResult() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/lambdaResult.kt"); + doTest(fileName); + } + + @TestMetadata("lambdaResultWithAssignments.kt") + public void testLambdaResultWithAssignments() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/lambdaResultWithAssignments.kt"); + doTest(fileName); + } + + @TestMetadata("lambdaResultWithDirectCall.kt") + public void testLambdaResultWithDirectCall() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/lambdaResultWithDirectCall.kt"); + doTest(fileName); + } + + @TestMetadata("lambdaResultWithDirectCallViaAssignment.kt") + public void testLambdaResultWithDirectCallViaAssignment() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/lambdaResultWithDirectCallViaAssignment.kt"); + doTest(fileName); + } + + @TestMetadata("localVal.kt") + public void testLocalVal() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/localVal.kt"); + doTest(fileName); + } + + @TestMetadata("localVar.kt") + public void testLocalVar() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/localVar.kt"); + doTest(fileName); + } + + @TestMetadata("memberValWithInitializer.kt") + public void testMemberValWithInitializer() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/memberValWithInitializer.kt"); + doTest(fileName); + } + + @TestMetadata("memberValWithSplitInitializer.kt") + public void testMemberValWithSplitInitializer() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/memberValWithSplitInitializer.kt"); + doTest(fileName); + } + + @TestMetadata("memberVarWithInitializer.kt") + public void testMemberVarWithInitializer() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/memberVarWithInitializer.kt"); + doTest(fileName); + } + + @TestMetadata("memberVarWithSplitInitializer.kt") + public void testMemberVarWithSplitInitializer() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/memberVarWithSplitInitializer.kt"); + doTest(fileName); + } + + @TestMetadata("noFieldInGetter.kt") + public void testNoFieldInGetter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/noFieldInGetter.kt"); + doTest(fileName); + } + + @TestMetadata("nonLocalReturn.kt") + public void testNonLocalReturn() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/nonLocalReturn.kt"); + doTest(fileName); + } + + @TestMetadata("notNullAssertion.kt") + public void testNotNullAssertion() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/notNullAssertion.kt"); + doTest(fileName); + } + + @TestMetadata("overridingFunctionResult.kt") + public void testOverridingFunctionResult() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/overridingFunctionResult.kt"); + doTest(fileName); + } + + @TestMetadata("overridingParameter.kt") + public void testOverridingParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/overridingParameter.kt"); + doTest(fileName); + } + + @TestMetadata("overridingPropertyGetterResult.kt") + public void testOverridingPropertyGetterResult() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/overridingPropertyGetterResult.kt"); + doTest(fileName); + } + + @TestMetadata("overridingPropertyResult.kt") + public void testOverridingPropertyResult() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/overridingPropertyResult.kt"); + doTest(fileName); + } + + @TestMetadata("primaryConstructorParameter.kt") + public void testPrimaryConstructorParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/primaryConstructorParameter.kt"); + doTest(fileName); + } + + @TestMetadata("primaryConstructorParameterWithDefault.kt") + public void testPrimaryConstructorParameterWithDefault() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/primaryConstructorParameterWithDefault.kt"); + doTest(fileName); + } + + @TestMetadata("qualifiedAssignmentsForQualifiedRef.kt") + public void testQualifiedAssignmentsForQualifiedRef() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/qualifiedAssignmentsForQualifiedRef.kt"); + doTest(fileName); + } + + @TestMetadata("qualifiedAssignmentsForSimpleRef.kt") + public void testQualifiedAssignmentsForSimpleRef() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/qualifiedAssignmentsForSimpleRef.kt"); + doTest(fileName); + } + + @TestMetadata("safeCast.kt") + public void testSafeCast() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/safeCast.kt"); + doTest(fileName); + } + + @TestMetadata("secondaryConstructorParameter.kt") + public void testSecondaryConstructorParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/secondaryConstructorParameter.kt"); + doTest(fileName); + } + + @TestMetadata("secondaryConstructorParameterWithDefault.kt") + public void testSecondaryConstructorParameterWithDefault() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/secondaryConstructorParameterWithDefault.kt"); + doTest(fileName); + } + + @TestMetadata("settersViaDelegateForQualifiedRef.kt") + public void testSettersViaDelegateForQualifiedRef() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/settersViaDelegateForQualifiedRef.kt"); + doTest(fileName); + } + + @TestMetadata("settersViaDelegateForSimpleRef.kt") + public void testSettersViaDelegateForSimpleRef() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/settersViaDelegateForSimpleRef.kt"); + doTest(fileName); + } + + @TestMetadata("settersViaJavaDelegate.kt") + public void testSettersViaJavaDelegate() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/settersViaJavaDelegate.kt"); + doTest(fileName); + } + + @TestMetadata("topLevelVal.kt") + public void testTopLevelVal() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/topLevelVal.kt"); + doTest(fileName); + } + + @TestMetadata("topLevelVar.kt") + public void testTopLevelVar() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/topLevelVar.kt"); + doTest(fileName); + } + + @TestMetadata("valParameter.kt") + public void testValParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/valParameter.kt"); + doTest(fileName); + } + + @TestMetadata("varParameter.kt") + public void testVarParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/varParameter.kt"); + doTest(fileName); + } + + @TestMetadata("whenExpression.kt") + public void testWhenExpression() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/whenExpression.kt"); + doTest(fileName); + } +} diff --git a/idea/tests/org/jetbrains/kotlin/idea/slicer/SlicerNullnessGroupingTestGenerated.java.172 b/idea/tests/org/jetbrains/kotlin/idea/slicer/SlicerNullnessGroupingTestGenerated.java.172 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/idea/tests/org/jetbrains/kotlin/idea/slicer/SlicerTreeTestGenerated.java.172 b/idea/tests/org/jetbrains/kotlin/idea/slicer/SlicerTreeTestGenerated.java.172 new file mode 100644 index 00000000000..7aeaa3c68d3 --- /dev/null +++ b/idea/tests/org/jetbrains/kotlin/idea/slicer/SlicerTreeTestGenerated.java.172 @@ -0,0 +1,693 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.slicer; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; +import org.jetbrains.kotlin.test.KotlinTestUtils; +import org.jetbrains.kotlin.test.TargetBackend; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.runner.RunWith; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("idea/testData/slicer") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class SlicerTreeTestGenerated extends AbstractSlicerTreeTest { + public void testAllFilesPresentInSlicer() throws Exception { + KotlinTestUtils.assertAllTestsPresentInSingleGeneratedClass(this.getClass(), new File("idea/testData/slicer"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY); + } + + @TestMetadata("inflow/anonymousFunBodyExpression.kt") + public void testInflow_AnonymousFunBodyExpression() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/anonymousFunBodyExpression.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/anonymousFunReturnExpression.kt") + public void testInflow_AnonymousFunReturnExpression() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/anonymousFunReturnExpression.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/cast.kt") + public void testInflow_Cast() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/cast.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/compositeAssignments.kt") + public void testInflow_CompositeAssignments() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/compositeAssignments.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/defaultGetterFieldInSetter.kt") + public void testInflow_DefaultGetterFieldInSetter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/defaultGetterFieldInSetter.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/delegateGetter.kt") + public void testInflow_DelegateGetter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/delegateGetter.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/delegateToJavaGetter.kt") + public void testInflow_DelegateToJavaGetter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/delegateToJavaGetter.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/diamondHierarchyJKMiddleClassFun.kt") + public void testInflow_DiamondHierarchyJKMiddleClassFun() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/diamondHierarchyJKMiddleClassFun.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/diamondHierarchyJKMiddleInterfaceFun.kt") + public void testInflow_DiamondHierarchyJKMiddleInterfaceFun() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/diamondHierarchyJKMiddleInterfaceFun.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/diamondHierarchyJKRootInterfaceFun.kt") + public void testInflow_DiamondHierarchyJKRootInterfaceFun() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/diamondHierarchyJKRootInterfaceFun.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/diamondHierarchyMiddleClassFun.kt") + public void testInflow_DiamondHierarchyMiddleClassFun() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/diamondHierarchyMiddleClassFun.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/diamondHierarchyMiddleInterfaceFun.kt") + public void testInflow_DiamondHierarchyMiddleInterfaceFun() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/diamondHierarchyMiddleInterfaceFun.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/diamondHierarchyRootInterfaceFun.kt") + public void testInflow_DiamondHierarchyRootInterfaceFun() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/diamondHierarchyRootInterfaceFun.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/doubleLambdaResult.kt") + public void testInflow_DoubleLambdaResult() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/doubleLambdaResult.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/funParamerer.kt") + public void testInflow_FunParamerer() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/funParamerer.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/funParamererWithDefault.kt") + public void testInflow_FunParamererWithDefault() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/funParamererWithDefault.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/funResultViaCallableRef.kt") + public void testInflow_FunResultViaCallableRef() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/funResultViaCallableRef.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/funResultViaCallableRefWithAssignment.kt") + public void testInflow_FunResultViaCallableRefWithAssignment() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/funResultViaCallableRefWithAssignment.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/funResultViaCallableRefWithDirectCall.kt") + public void testInflow_FunResultViaCallableRefWithDirectCall() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/funResultViaCallableRefWithDirectCall.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/funWithExpressionBody.kt") + public void testInflow_FunWithExpressionBody() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/funWithExpressionBody.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/funWithReturnExpressions.kt") + public void testInflow_FunWithReturnExpressions() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/funWithReturnExpressions.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/getterAndSetterUsingField.kt") + public void testInflow_GetterAndSetterUsingField() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/getterAndSetterUsingField.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/getterExpressionBody.kt") + public void testInflow_GetterExpressionBody() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/getterExpressionBody.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/getterReturnExpression.kt") + public void testInflow_GetterReturnExpression() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/getterReturnExpression.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/ifExpression.kt") + public void testInflow_IfExpression() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/ifExpression.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/lambdaResult.kt") + public void testInflow_LambdaResult() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/lambdaResult.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/lambdaResultWithAssignments.kt") + public void testInflow_LambdaResultWithAssignments() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/lambdaResultWithAssignments.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/lambdaResultWithDirectCall.kt") + public void testInflow_LambdaResultWithDirectCall() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/lambdaResultWithDirectCall.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/lambdaResultWithDirectCallViaAssignment.kt") + public void testInflow_LambdaResultWithDirectCallViaAssignment() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/lambdaResultWithDirectCallViaAssignment.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/localVal.kt") + public void testInflow_LocalVal() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/localVal.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/localVar.kt") + public void testInflow_LocalVar() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/localVar.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/memberValWithInitializer.kt") + public void testInflow_MemberValWithInitializer() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/memberValWithInitializer.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/memberValWithSplitInitializer.kt") + public void testInflow_MemberValWithSplitInitializer() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/memberValWithSplitInitializer.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/memberVarWithInitializer.kt") + public void testInflow_MemberVarWithInitializer() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/memberVarWithInitializer.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/memberVarWithSplitInitializer.kt") + public void testInflow_MemberVarWithSplitInitializer() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/memberVarWithSplitInitializer.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/noFieldInGetter.kt") + public void testInflow_NoFieldInGetter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/noFieldInGetter.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/nonLocalReturn.kt") + public void testInflow_NonLocalReturn() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/nonLocalReturn.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/notNullAssertion.kt") + public void testInflow_NotNullAssertion() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/notNullAssertion.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/overridingFunctionResult.kt") + public void testInflow_OverridingFunctionResult() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/overridingFunctionResult.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/overridingParameter.kt") + public void testInflow_OverridingParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/overridingParameter.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/overridingPropertyGetterResult.kt") + public void testInflow_OverridingPropertyGetterResult() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/overridingPropertyGetterResult.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/overridingPropertyResult.kt") + public void testInflow_OverridingPropertyResult() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/overridingPropertyResult.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/primaryConstructorParameter.kt") + public void testInflow_PrimaryConstructorParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/primaryConstructorParameter.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/primaryConstructorParameterWithDefault.kt") + public void testInflow_PrimaryConstructorParameterWithDefault() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/primaryConstructorParameterWithDefault.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/qualifiedAssignmentsForQualifiedRef.kt") + public void testInflow_QualifiedAssignmentsForQualifiedRef() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/qualifiedAssignmentsForQualifiedRef.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/qualifiedAssignmentsForSimpleRef.kt") + public void testInflow_QualifiedAssignmentsForSimpleRef() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/qualifiedAssignmentsForSimpleRef.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/safeCast.kt") + public void testInflow_SafeCast() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/safeCast.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/secondaryConstructorParameter.kt") + public void testInflow_SecondaryConstructorParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/secondaryConstructorParameter.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/secondaryConstructorParameterWithDefault.kt") + public void testInflow_SecondaryConstructorParameterWithDefault() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/secondaryConstructorParameterWithDefault.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/settersViaDelegateForQualifiedRef.kt") + public void testInflow_SettersViaDelegateForQualifiedRef() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/settersViaDelegateForQualifiedRef.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/settersViaDelegateForSimpleRef.kt") + public void testInflow_SettersViaDelegateForSimpleRef() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/settersViaDelegateForSimpleRef.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/settersViaJavaDelegate.kt") + public void testInflow_SettersViaJavaDelegate() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/settersViaJavaDelegate.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/topLevelVal.kt") + public void testInflow_TopLevelVal() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/topLevelVal.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/topLevelVar.kt") + public void testInflow_TopLevelVar() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/topLevelVar.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/valParameter.kt") + public void testInflow_ValParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/valParameter.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/varParameter.kt") + public void testInflow_VarParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/varParameter.kt"); + doTest(fileName); + } + + @TestMetadata("inflow/whenExpression.kt") + public void testInflow_WhenExpression() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/inflow/whenExpression.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/anonymousFunBodyExpression.kt") + public void testOutflow_AnonymousFunBodyExpression() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/anonymousFunBodyExpression.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/anonymousFunReturnExpression.kt") + public void testOutflow_AnonymousFunReturnExpression() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/anonymousFunReturnExpression.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/callArgument.kt") + public void testOutflow_CallArgument() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/callArgument.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/callArgumentKJK.kt") + public void testOutflow_CallArgumentKJK() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/callArgumentKJK.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/cast.kt") + public void testOutflow_Cast() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/cast.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/defaultExplicitPrimaryConstructorCalls.kt") + public void testOutflow_DefaultExplicitPrimaryConstructorCalls() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/defaultExplicitPrimaryConstructorCalls.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/diamondHierarchyJKLeafClassFun.kt") + public void testOutflow_DiamondHierarchyJKLeafClassFun() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/diamondHierarchyJKLeafClassFun.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/diamondHierarchyJKMiddleClassFun.kt") + public void testOutflow_DiamondHierarchyJKMiddleClassFun() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/diamondHierarchyJKMiddleClassFun.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/diamondHierarchyJKMiddleInterfaceFun.kt") + public void testOutflow_DiamondHierarchyJKMiddleInterfaceFun() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/diamondHierarchyJKMiddleInterfaceFun.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/diamondHierarchyLeafClassFun.kt") + public void testOutflow_DiamondHierarchyLeafClassFun() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/diamondHierarchyLeafClassFun.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/diamondHierarchyMiddleClassFun.kt") + public void testOutflow_DiamondHierarchyMiddleClassFun() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/diamondHierarchyMiddleClassFun.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/diamondHierarchyMiddleInterfaceFun.kt") + public void testOutflow_DiamondHierarchyMiddleInterfaceFun() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/diamondHierarchyMiddleInterfaceFun.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/doubleLambdaResult.kt") + public void testOutflow_DoubleLambdaResult() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/doubleLambdaResult.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/explicitLambdaReturnExpression.kt") + public void testOutflow_ExplicitLambdaReturnExpression() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/explicitLambdaReturnExpression.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/extensionIndexingDereferences.kt") + public void testOutflow_ExtensionIndexingDereferences() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/extensionIndexingDereferences.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/forVariable.kt") + public void testOutflow_ForVariable() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/forVariable.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/funBodyExpression.kt") + public void testOutflow_FunBodyExpression() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/funBodyExpression.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/functionCalls.kt") + public void testOutflow_FunctionCalls() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/functionCalls.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/funParameterUsages.kt") + public void testOutflow_FunParameterUsages() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/funParameterUsages.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/funResultViaCallableRef.kt") + public void testOutflow_FunResultViaCallableRef() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/funResultViaCallableRef.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/funResultViaCallableRefWithAssignment.kt") + public void testOutflow_FunResultViaCallableRefWithAssignment() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/funResultViaCallableRefWithAssignment.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/funResultViaCallableRefWithDirectCall.kt") + public void testOutflow_FunResultViaCallableRefWithDirectCall() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/funResultViaCallableRefWithDirectCall.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/funReturnExpression.kt") + public void testOutflow_FunReturnExpression() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/funReturnExpression.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/getFunCalls.kt") + public void testOutflow_GetFunCalls() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/getFunCalls.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/getterExpressionBody.kt") + public void testOutflow_GetterExpressionBody() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/getterExpressionBody.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/getterReturnExpression.kt") + public void testOutflow_GetterReturnExpression() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/getterReturnExpression.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/ifExpression.kt") + public void testOutflow_IfExpression() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/ifExpression.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/indexingDereferences.kt") + public void testOutflow_IndexingDereferences() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/indexingDereferences.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/jvmFieldMemberPropertyJavaUsages.kt") + public void testOutflow_JvmFieldMemberPropertyJavaUsages() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/jvmFieldMemberPropertyJavaUsages.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/lambdaResult.kt") + public void testOutflow_LambdaResult() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/lambdaResult.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/lambdaResultWithAssignments.kt") + public void testOutflow_LambdaResultWithAssignments() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/lambdaResultWithAssignments.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/lambdaResultWithDirectCall.kt") + public void testOutflow_LambdaResultWithDirectCall() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/lambdaResultWithDirectCall.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/lambdaResultWithDirectCallViaAssignment.kt") + public void testOutflow_LambdaResultWithDirectCallViaAssignment() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/lambdaResultWithDirectCallViaAssignment.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/localVariableUsages.kt") + public void testOutflow_LocalVariableUsages() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/localVariableUsages.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/memberPropertyUsages.kt") + public void testOutflow_MemberPropertyUsages() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/memberPropertyUsages.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/nonLocalReturn.kt") + public void testOutflow_NonLocalReturn() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/nonLocalReturn.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/notNullAssertion.kt") + public void testOutflow_NotNullAssertion() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/notNullAssertion.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/operatorCallDereferences.kt") + public void testOutflow_OperatorCallDereferences() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/operatorCallDereferences.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/operatorFunCalls.kt") + public void testOutflow_OperatorFunCalls() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/operatorFunCalls.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/overridingFunctionResult.kt") + public void testOutflow_OverridingFunctionResult() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/overridingFunctionResult.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/overridingFunctionResultWithJava.kt") + public void testOutflow_OverridingFunctionResultWithJava() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/overridingFunctionResultWithJava.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/overridingParameter.kt") + public void testOutflow_OverridingParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/overridingParameter.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/overridingPropertyGetterResult.kt") + public void testOutflow_OverridingPropertyGetterResult() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/overridingPropertyGetterResult.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/overridingPropertyResult.kt") + public void testOutflow_OverridingPropertyResult() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/overridingPropertyResult.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/primaryConstructorCalls.kt") + public void testOutflow_PrimaryConstructorCalls() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/primaryConstructorCalls.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/primaryConstructorParameterUsages.kt") + public void testOutflow_PrimaryConstructorParameterUsages() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/primaryConstructorParameterUsages.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/secondaryConstructorCalls.kt") + public void testOutflow_SecondaryConstructorCalls() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/secondaryConstructorCalls.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/simpleCallDereferences.kt") + public void testOutflow_SimpleCallDereferences() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/simpleCallDereferences.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/topLevelPropertyUsages.kt") + public void testOutflow_TopLevelPropertyUsages() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/topLevelPropertyUsages.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/usagesInLoopRange.kt") + public void testOutflow_UsagesInLoopRange() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/usagesInLoopRange.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/usagesInTemplates.kt") + public void testOutflow_UsagesInTemplates() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/usagesInTemplates.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/valParameter.kt") + public void testOutflow_ValParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/valParameter.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/varParameter.kt") + public void testOutflow_VarParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/varParameter.kt"); + doTest(fileName); + } + + @TestMetadata("outflow/whenExpression.kt") + public void testOutflow_WhenExpression() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/slicer/outflow/whenExpression.kt"); + doTest(fileName); + } +}