AA: add tests for PsiDeclarationAndKtSymbolEqualityChecker
This commit is contained in:
committed by
Ilya Kirillov
parent
846ab7d97b
commit
2a864b3685
+12
@@ -46,6 +46,18 @@ public class FirStandaloneNormalAnalysisSourceModuleDecompiledPsiDeclarationProv
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/standalone/singleModule"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/standalone/singleModule"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("capitalize_default.kt")
|
||||||
|
public void testCapitalize_default() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/standalone/singleModule/capitalize_default.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("capitalize_locale.kt")
|
||||||
|
public void testCapitalize_locale() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/standalone/singleModule/capitalize_locale.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("multipleFiles.kt")
|
@TestMetadata("multipleFiles.kt")
|
||||||
public void testMultipleFiles() throws Exception {
|
public void testMultipleFiles() throws Exception {
|
||||||
|
|||||||
+18
@@ -6,11 +6,29 @@
|
|||||||
package org.jetbrains.kotlin.analysis.api.standalone.fir.test.cases.components.psiDeclarationProvider
|
package org.jetbrains.kotlin.analysis.api.standalone.fir.test.cases.components.psiDeclarationProvider
|
||||||
|
|
||||||
import com.intellij.psi.PsiElement
|
import com.intellij.psi.PsiElement
|
||||||
|
import com.intellij.psi.PsiMethod
|
||||||
|
import com.intellij.psi.PsiParameter
|
||||||
import org.jetbrains.kotlin.psi.KtElement
|
import org.jetbrains.kotlin.psi.KtElement
|
||||||
|
|
||||||
object TestPsiElementRenderer {
|
object TestPsiElementRenderer {
|
||||||
fun render(psiElement: PsiElement): String = when (psiElement) {
|
fun render(psiElement: PsiElement): String = when (psiElement) {
|
||||||
is KtElement -> psiElement.text
|
is KtElement -> psiElement.text
|
||||||
|
is PsiMethod -> buildString {
|
||||||
|
append("PsiMethod:")
|
||||||
|
append(psiElement.name)
|
||||||
|
append("(")
|
||||||
|
psiElement.parameterList.parameters.joinTo(this) { render(it) }
|
||||||
|
append("): ")
|
||||||
|
append(psiElement.returnType)
|
||||||
|
}
|
||||||
|
is PsiParameter -> buildString {
|
||||||
|
if (psiElement.isVarArgs) {
|
||||||
|
append("vararg ")
|
||||||
|
}
|
||||||
|
append(psiElement.name)
|
||||||
|
append(": ")
|
||||||
|
append(psiElement.type)
|
||||||
|
}
|
||||||
else -> psiElement.toString()
|
else -> psiElement.toString()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
// WITH_STDLIB
|
||||||
|
|
||||||
|
fun box() {
|
||||||
|
"with default".capital<caret>ize()
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
Resolved to:
|
||||||
|
PsiMethod:capitalize($this$capitalize: PsiType:String): PsiType:String
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
// WITH_STDLIB
|
||||||
|
|
||||||
|
fun box() {
|
||||||
|
"without default".capital<caret>ize(Locale.US)
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
Resolved to:
|
||||||
|
PsiMethod:capitalize($this$capitalize: PsiType:String, locale: PsiType:Locale): PsiType:String
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
Resolved to:
|
Resolved to:
|
||||||
PsiMethod:TODO
|
PsiMethod:TODO(reason: PsiType:String): PsiType:Void
|
||||||
Reference in New Issue
Block a user