FIR IDE: add test for super keyword completion with qualifier
This commit is contained in:
committed by
TeamCityServer
parent
0a6243fc67
commit
48b69b4f3f
+7
@@ -18,6 +18,7 @@ import org.jetbrains.kotlin.generators.TestGroup
|
|||||||
import org.jetbrains.kotlin.generators.impl.generateTestGroupSuite
|
import org.jetbrains.kotlin.generators.impl.generateTestGroupSuite
|
||||||
import org.jetbrains.kotlin.generators.util.TestGeneratorUtil
|
import org.jetbrains.kotlin.generators.util.TestGeneratorUtil
|
||||||
import org.jetbrains.kotlin.generators.util.TestGeneratorUtil.KT_OR_KTS
|
import org.jetbrains.kotlin.generators.util.TestGeneratorUtil.KT_OR_KTS
|
||||||
|
import org.jetbrains.kotlin.generators.util.TestGeneratorUtil.KT_WITHOUT_FIR_PREFIX
|
||||||
import org.jetbrains.kotlin.generators.util.TestGeneratorUtil.KT_OR_KTS_WITHOUT_DOTS_IN_NAME
|
import org.jetbrains.kotlin.generators.util.TestGeneratorUtil.KT_OR_KTS_WITHOUT_DOTS_IN_NAME
|
||||||
import org.jetbrains.kotlin.generators.util.TestGeneratorUtil.KT_WITHOUT_DOTS_IN_NAME
|
import org.jetbrains.kotlin.generators.util.TestGeneratorUtil.KT_WITHOUT_DOTS_IN_NAME
|
||||||
import org.jetbrains.kotlin.idea.AbstractExpressionSelectionTest
|
import org.jetbrains.kotlin.idea.AbstractExpressionSelectionTest
|
||||||
@@ -1217,6 +1218,12 @@ fun main(args: Array<String>) {
|
|||||||
|
|
||||||
testClass<AbstractFirKeywordCompletionTest> {
|
testClass<AbstractFirKeywordCompletionTest> {
|
||||||
model("keywords", recursive = false, pattern = KT_WITHOUT_FIR_PREFIX)
|
model("keywords", recursive = false, pattern = KT_WITHOUT_FIR_PREFIX)
|
||||||
|
model(
|
||||||
|
"../../idea-fir/testData/completion/keywords",
|
||||||
|
testClassName = "KeywordsFir",
|
||||||
|
recursive = false,
|
||||||
|
pattern = KT_WITHOUT_FIR_PREFIX
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
|
// FIR_COMPARISON
|
||||||
|
class X: List<Int>, Comparable<Int> {
|
||||||
|
init {
|
||||||
|
sup<caret>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// EXIST: super
|
||||||
|
// EXIST: super<List>
|
||||||
|
// EXIST: super<Comparable>
|
||||||
|
// NOTHING_ELSE
|
||||||
Generated
+23
-2
@@ -17,10 +17,12 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
@TestMetadata("idea/idea-completion/testData/keywords")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public class FirKeywordCompletionTestGenerated extends AbstractFirKeywordCompletionTest {
|
public class FirKeywordCompletionTestGenerated extends AbstractFirKeywordCompletionTest {
|
||||||
|
@TestMetadata("idea/idea-completion/testData/keywords")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class Keywords extends AbstractFirKeywordCompletionTest {
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
private void runTest(String testDataFilePath) throws Exception {
|
||||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||||
}
|
}
|
||||||
@@ -608,4 +610,23 @@ public class FirKeywordCompletionTestGenerated extends AbstractFirKeywordComplet
|
|||||||
public void testUseSiteTargetForPrimaryConstructorParameter() throws Exception {
|
public void testUseSiteTargetForPrimaryConstructorParameter() throws Exception {
|
||||||
runTest("idea/idea-completion/testData/keywords/UseSiteTargetForPrimaryConstructorParameter.kt");
|
runTest("idea/idea-completion/testData/keywords/UseSiteTargetForPrimaryConstructorParameter.kt");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("idea/idea-completion/testData/../../idea-fir/testData/completion/keywords")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class KeywordsFir extends AbstractFirKeywordCompletionTest {
|
||||||
|
private void runTest(String testDataFilePath) throws Exception {
|
||||||
|
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testAllFilesPresentInKeywordsFir() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/idea-completion/testData/../../idea-fir/testData/completion/keywords"), Pattern.compile("^(.+)(?<!\\.fir)\\.kt$"), null, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("superWithQualifier.kt")
|
||||||
|
public void testSuperWithQualifier() throws Exception {
|
||||||
|
runTest("idea/idea-completion/testData/../../idea-fir/testData/completion/keywords/superWithQualifier.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user