Test for KT-7134 Command line entry point (main function is highlighted as unused)

#KT-7134 obsolete
This commit is contained in:
Evgeny Gerashchenko
2015-07-09 16:51:03 +03:00
parent e3c5e2eca2
commit 1cf433909b
5 changed files with 26 additions and 0 deletions
@@ -0,0 +1,2 @@
<problems>
</problems>
@@ -0,0 +1 @@
// INSPECTION_CLASS: org.jetbrains.kotlin.idea.inspections.UnusedSymbolInspection
+3
View File
@@ -0,0 +1,3 @@
fun main(args: Array<String>) {
}
@@ -35,6 +35,7 @@ import org.jetbrains.kotlin.idea.test.JetLightCodeInsightFixtureTestCase
import org.jetbrains.kotlin.test.InTextDirectivesUtils
import org.jetbrains.kotlin.test.JetTestUtils
import java.io.File
import kotlin.test.assertFalse
public abstract class AbstractJetInspectionTest: JetLightCodeInsightFixtureTestCase() {
companion object {
@@ -79,10 +80,20 @@ public abstract class AbstractJetInspectionTest: JetLightCodeInsightFixtureTestC
configureByText(file.getName(), fileText)!!
}
val isJs = srcDir.endsWith("js")
val isWithRuntime = psiFiles.any { InTextDirectivesUtils.findStringWithPrefixes(it.getText(), "// WITH_RUNTIME") != null }
val fullJdk = psiFiles.any { InTextDirectivesUtils.findStringWithPrefixes(it.getText(), "// FULL_JDK") != null }
if (isJs) {
assertFalse(isWithRuntime)
assertFalse(fullJdk)
}
try {
if (isJs) {
ConfigLibraryUtil.configureKotlinJsRuntime(myFixture.getModule())
}
if (isWithRuntime) {
ConfigLibraryUtil.configureKotlinRuntimeAndSdk(
myFixture.getModule(),
@@ -103,6 +114,9 @@ public abstract class AbstractJetInspectionTest: JetLightCodeInsightFixtureTestC
if (isWithRuntime) {
ConfigLibraryUtil.unConfigureKotlinRuntimeAndSdk(myFixture.getModule(), IdeaTestUtil.getMockJdk17())
}
if (isJs) {
ConfigLibraryUtil.unConfigureKotlinJsRuntimeAndSdk(myFixture.getModule(), IdeaTestUtil.getMockJdk17())
}
}
}
}
@@ -118,6 +118,12 @@ public class JetInspectionTestGenerated extends AbstractJetInspectionTest {
doTest(fileName);
}
@TestMetadata("unusedSymbol/js/inspectionData/inspections.test")
public void testUnusedSymbol_js_inspectionData_Inspections_test() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/inspections/unusedSymbol/js/inspectionData/inspections.test");
doTest(fileName);
}
@TestMetadata("unusedSymbol/object/inspectionData/inspections.test")
public void testUnusedSymbol_object_inspectionData_Inspections_test() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/inspections/unusedSymbol/object/inspectionData/inspections.test");