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);
|
||||
}
|
||||
|
||||
@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
|
||||
@TestMetadata("multipleFiles.kt")
|
||||
public void testMultipleFiles() throws Exception {
|
||||
|
||||
+18
@@ -6,11 +6,29 @@
|
||||
package org.jetbrains.kotlin.analysis.api.standalone.fir.test.cases.components.psiDeclarationProvider
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.PsiMethod
|
||||
import com.intellij.psi.PsiParameter
|
||||
import org.jetbrains.kotlin.psi.KtElement
|
||||
|
||||
object TestPsiElementRenderer {
|
||||
fun render(psiElement: PsiElement): String = when (psiElement) {
|
||||
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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user