191: KotlinUastApiTest.kt missed bunch aligning fix
This commit is contained in:
@@ -316,6 +316,44 @@ class KotlinUastApiTest : AbstractKotlinUastTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testNestedAnnotationParameters() = doTest("AnnotationComplex") { _, file ->
|
||||
|
||||
fun UFile.annotationAndParam(refText: String, check: (PsiAnnotation, String?) -> Unit) {
|
||||
findElementByTextFromPsi<UElement>(refText)
|
||||
.let { expression ->
|
||||
val (annotation: PsiAnnotation, paramname: String?) =
|
||||
getContainingAnnotationEntry(expression) ?: kfail("annotation not found for '$refText' ($expression)")
|
||||
check(annotation, paramname)
|
||||
}
|
||||
}
|
||||
|
||||
file.annotationAndParam("sv1") { annotation, paramname ->
|
||||
assertEquals("Annotation", annotation.qualifiedName)
|
||||
assertEquals(null, paramname)
|
||||
}
|
||||
file.annotationAndParam("sv2") { annotation, paramname ->
|
||||
assertEquals("Annotation", annotation.qualifiedName)
|
||||
assertEquals(null, paramname)
|
||||
}
|
||||
file.annotationAndParam("sar1") { annotation, paramname ->
|
||||
assertEquals("Annotation", annotation.qualifiedName)
|
||||
assertEquals("strings", paramname)
|
||||
}
|
||||
file.annotationAndParam("sar2") { annotation, paramname ->
|
||||
assertEquals("Annotation", annotation.qualifiedName)
|
||||
assertEquals("strings", paramname)
|
||||
}
|
||||
file.annotationAndParam("[sar]1") { annotation, paramname ->
|
||||
assertEquals("Annotation", annotation.qualifiedName)
|
||||
assertEquals("strings", paramname)
|
||||
}
|
||||
file.annotationAndParam("[sar]2") { annotation, paramname ->
|
||||
assertEquals("Annotation", annotation.qualifiedName)
|
||||
assertEquals("strings", paramname)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
fun testParametersDisorder() = doTest("ParametersDisorder") { _, file ->
|
||||
|
||||
Reference in New Issue
Block a user